How to reference jQuery in SharePoint2010
- by ybbest
In normal asp.net development, in order to add jQuery to your solution you need to add the following script to your Master page.
<script language=”javascript” type=”text/javascript” src=”Scripts/jquery-1.4.1.min.js”></script>
There are not many differences in referencing jQuery in SharePoint2010; in fact you got quite a few ways to achieve this. The first thing you need to do is to deploy jQuery using SharePoint module template in Visual studio. Then you can choose one of the following ways of referencing jQuery.
1. Using a Delegate Control
2. in the master Page
3. Ad hoc (e.g. in a site page or web part)
4. Using a Custom Action (Can be used as Sandbox solution, you can find example here.)
References:
jquery
How to bootstrap JQuery on every SharePoint page, even in the Sandbox
Referencing Javascript Files with SharePoint 2010 Custom Actions using SciptSrc