B i t s O f S h a r e P o i n t C o n s u l t i n g L L C > B l o g P o i n t > Posts > JQuery - Manage Multiple implementations of a JQuery Solution
JQuery - Manage Multiple implementations of a JQuery Solution
This post is all about how do you manage all of the great solutions being created with JQuery and Javascripts.  Most of these solutions request that you put the solutions into a CEWP and paste the code into the Source Editor.  This is fine if you do it once or twice, but what if you deploy this on many many sites? 

How do you update the script when changes are made? You will have to remember each location and update the CEWP. No thank you.

I started out this way and quickly realized that I was going down a road that would lead to insanity, keeping track and managing all the CEWP with the code.


Centralize all these great solutions/scripts into one location and then have each CEWP link to the centralized script.  All the JQuery and Javascript solutions can be saved as a .txt file.

Can this be done? YES.

The CEWP gives us the ability to link to a text file, where we can have a JQuery or Javascript code.  Now we are talking!  See the image below.

This image shows me using the Content link to link back to the central location that I have JQuery solutions in text files.  When I update the file tip-document-right.txt with an updated script all location where I have deployed this way will be instantly updated. The is GREAT!

Now there are two wonderful things about this. 

  1. One is that we can add a CEWP anywhere and link to the script file in a central place.
  2. Two is that you can export the CEWP and create a webpart that can be used by anyone.  This webpart would have the link to the central script site. 

You now can let everyone use the script solution or webpart AND have the ability to update the script and know that the update will be populated every where the CEWP/webpart and link was deployed.

You will then have the freedom to let others utilize the solution and be able manage the script.  Your site will then begin to look like this:

Christophe at pathtosharepoint.wordpress.com has a great article on how to implement something similar.  His solution is about having a single script file that is used across sites.  This works well when you want to have the same scripts available to multiple sites.  Check out his post here: http://pathtosharepoint.wordpress.com/2009/02/15/a-content-editor-web-part-for-every-home/

My post is about how do you let your users have access to these solutions, add only the ones they want, still maintain control of managing the script, be able to update the script and have all site instantly benefit from the update.

Hope this helps,



There are no comments yet for this post.
Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.


Body *

Addition: 2 + 1 = *

Please complete this equation.


This is optional.

 T o p i c P o i n t

 E x a m p l e P o i n t