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

 

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