简体   繁体   English

如何在sharepoint 2007中包含javascript(.js)文件

[英]how to include javascript (.js) file in sharepoint 2007

what is the way to use only one centralised javascript file in sharepoint 2007 and how we can refer to that js file through .aspx pages or custom master pages in sharepoint designer 在sharepoint 2007中仅使用一个集中式javascript文件的方式是什么,以及如何通过sharepoint Designer中的.aspx页或自定义母版页引用该js文件?

Thanks 谢谢

You can place it in the 12 hive in the layouts/1033 folder and then place a relative server reference in your page or masterpage. 您可以将其放置在layouts / 1033文件夹中的12个配置单元中,然后在页面或母版页中放置一个相对的服务器引用。 Here's a good thread on this: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/a33634c7-19f7-401e-ae58-84bfe66a529e/ 这是一个很好的线程: http : //social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/a33634c7-19f7-401e-ae58-84bfe66a529e/

You could also create a document library in your site collection in the root web site and refer to it that way too. 您也可以在根网站的网站集中创建一个文档库,并以这种方式进行引用。 If you do it this way, you can have versioning and it might be easier to update. 如果以这种方式进行操作,则可以进行版本控制,并且更新起来可能会更容易。 Plus you can put security around the resource just like any other document. 另外,您可以像其他任何文档一样对资源进行安全保护。 Some people like to put javascript files in their masterpage gallery as well. 有些人也喜欢将javascript文件放在其母版页库中。 I think if you create a publishing site, it has a styles document library you can use for this purpose. 我认为,如果您创建一个发布站点,则该站点具有可用于此目的的样式文档库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM