【发布时间】:2011-11-28 07:02:40
【问题描述】:
我将[script.js][1] 与我的母版页一起用作异步脚本加载器。使用母版页文件作为母版页,根目录上的页面工作正常。当涉及到像下面这样的文件夹内的网页时,路径就不能正常工作。脚本加载器从错误的 url 加载文件。无论路径如何,我如何使其从正确的 url 加载。
Admin
-users
-createuser.aspx
加载器文件的内容
//show the path to load scripts files from
$script.path("/js/");
//load jquery first and then load the dependent scripts
$script.order(["jquery.min","slider"],function(){
//load the application specific file
$script("app");
});
我如何在客户端获取 Web 应用程序的路径,例如路径应该解析为
http://domainname/virtualdirectory/js/
【问题讨论】:
-
您好,您需要这些来自 JS 文件还是来自 Aspx 文件的动态 URL?
-
@HanletEscaño 如果它是 aspx 文件,那将很容易。这是我需要这些 url 的 js 文件
标签: c# javascript asp.net master-pages dynamic-script-loading