在 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/