Sharepoint 2010:如何在Master page引用jQuery

1. 以管理员的身份登录网站,进入Site Actions>Site settings>Site Adimistration>Site libraries and lists>Customize "Style Library"
,找到存放js的url,在浏览器上打开。

2.在Style Library文件夹,新建名为“Scripts”的文件夹,用于存放js文件。

3.在jQuery官方网http://jquery.com/下载最新版本jquery-1.6.4.min.js,并更名为“jQuery.js”。 接着publish该文件。

4.打开Master page,在"PlaceHolderAdditonalPageHead"前面添加引用:

<script src="/Style%20Library/Scripts/{jquery library file}.js" type="text/javascript"></script>

5.注意js冲突。

若有其他好方法,麻烦留言,谢谢。

参考资料:

http://stackoverflow.com/questions/960143/how-to-use-jquery-correctly-in-sharepoint-web-part-jquery-doesnt-always-fire

http://fitandfinish.ironworks.com/2010/01/the-best-way-to-add-custom-javascript-and-jquery-to-sharepoint.html

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章