asp.net - 最佳实践 - MOSS 07 和 Javascript 文件?

标签 asp.net javascript web-parts sharepoint-2007

在 MOSS 2007 中使用 javascript 文件的建议方法是什么? 12 Hive 中的某处或直接在站点的虚拟目录中的脚本目录中?或者可能作为 Web 部件中的嵌入式资源?

最佳答案

就个人而言,这完全取决于 JavaScript 文件的用途。如果它们要在多个组件之间共享,那么我建议将它们放置在 12-hive 中。但是,如果它们将被隔离到单个组件(例如 Web 部件),那么将它们作为资源嵌入也可以。

This article有关于部署 Web 部件资源的最佳实践的讨论,您可能会发现这很有用,结论是:

In this post, you have seen how to both link to and embed Web Part resources. Each has its own advantages and disadvantages, mostly boiling down to whether you need to maintain the resource separately from the Web Part. In both cases, the resource file can be cached, so there is little performance difference from each option. Feel free to use one of these two approaches for your next web part.

关于asp.net - 最佳实践 - MOSS 07 和 Javascript 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/530027/

相关文章:

javascript - 如何在 if 语句中禁用/伪造 .remove() ?

javascript - 当我创建许多对象时,kineticjs 会变慢

sharepoint - 将用户控件添加到 Sharepoint 2013 中的 Web 部件

c# - 在 Sharepoint 2010 中使用 Entity Framework 作为 Web 部件的数据源

c# - WebApi 2.0 中的 MEF 未解析

c# - 限制路由到 ASP.NET Core 中的 Controller 命名空间

asp.net - ASP.net MVC 中的 viewstate 等价物是什么

c# - TreeView 数据绑定(bind) - 来自 c# 对象?

javascript - 从 javascript SDK 共享图像不会加载图像?

asp.net - 将 WebPart 添加到应用程序页面