How to reference jQuery in SharePoint2010
Posted
by ybbest
on YBBest
See other posts from YBBest
or by ybbest
Published on Mon, 20 Jun 2011 10:10:20 +0000
Indexed on
2011/06/20
16:40 UTC
Read the original article
Hit count: 500
jQuery
|SharePoint 2010
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:
How to bootstrap JQuery on every SharePoint page, even in the Sandbox
Referencing Javascript Files with SharePoint 2010 Custom Actions using SciptSrc
© YBBest or respective owner