简体   繁体   English

sharepoint2010:使用Visual Studio 2010的Sharepoint 2010中的JavaScript

[英]sharepoint2010 : javascript in Sharepoint 2010 using visual studio 2010

我们可以使用Visual Studio 2010在sharepoint 2010 Web部件中使用javascript吗?

Yes, See Creating a Web Part with Client-side Script 是的,请参阅使用客户端脚本创建Web部件

http://msdn.microsoft.com/en-us/library/dd584169(v=office.11).aspx http://msdn.microsoft.com/zh-CN/library/dd584169(v=office.11​​).aspx

You can utilize JavaScript in your web parts just as you would HTML or CSS. 您可以像在HTML或CSS中一样在Web部件中使用JavaScript。 As for it's location, a common place to store these files is in the Style Library. 至于位置,通常在样式库中存储这些文件。 You would then create a reference to the JavaScript file in your masterpage or page layout (depending on your needs) where it would be available at runtime. 然后,您将在母版页或页面布局中创建对JavaScript文件的引用(取决于您的需求),并在运行时可用。

I would recommend using SharePoint Designer for managing and versioning these style-related files. 我建议使用SharePoint Designer来管理和版本管理与样式相关的文件。

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

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