I have written a simple solution for SharePoint Foundation 2010 and SharePoint Server 2010 to allow site administrators to add the jQuery library to each SharePoint page without modifying master pages or adding it with a Content Editor Web Part.
This feature is installed to the farm and is enabled on a per-site basis. By navigating to Site Actions > Site Settings > Look and Feel > jQuery Settings, the site administrator can also configure the version of jQuery to load (1.3.2 through 1.6.1) and where the jQuery library will be delivered from (the local site or one of the available Content Delivery Networks).
To Install the Solution
- Extract files to local hard drive (i.e. to c:TEMP)
- Open the SharePoint 2010 Management Shell (PowerShell)
- Use Add-SPSolution to upload the WSP file to the SharePoint farm
1Add-SPSolution -LiteralPath C:TEMPPhoenixCodes.jQuery.wsp
- Use Install-SPSolution to deploy the WSP to the farm
1Install-SPSolution -Identity phoenixcodes.jquery.wsp -GACDeployment
- To enable the feature on a specific site, visit Site Actions > Site Features.
- Activate the “Phoenix Codes – Globally Load jQuery Library” feature.
I hope you find this solution helpful. Thanks.
Hello. This wsp is really nice but what about implementing also Jquery UI. Or are you able to add link also to source of this project. Thank you very much.
I posted an article about how to add anything to the header using the AdditionalPageHead control here:http://beta.johnchapman.net/sharepoint-2010-programmatically-add-javascript-meta-tags-and-css-styles-to-the-header-of-every-page/. Just note, you cannot have more than one solution using that control without having issues (i.e. if you write your own, disable mine).
Hello. Thank you I will Try it and let you know if I have some problems with this. Again Thank you very much for your help.
neat solution! is it possible to post the source code ?
See http://beta.johnchapman.net/sharepoint-2010-programmatically-add-javascript-meta-tags-and-css-styles-to-the-header-of-every-page/.
John, there is a problem with the paths in your solution. If you use firebug you get 404 for jquery because it is looking in http://servername/_Layouts/PhoenixCodes.jQueryWebPart/jquery-1.6.1.min.js however under the hive 14 the path is actually PhoenixCodes.jQuery NOT PhoenixCodes.jQueryWebPart.