我在网址上有不同的脚本:
externalurl / INTE /普通/ JS / script1.js
externalurl / INTE /普通/ JS / script2.js
externalurl / INTE //公共/ JS / script3.js
externalurl / INTE //公共/ JS / script4.js
externalurl / INTE //公共/ JS / script15.js
如何在我的解决方案中创建外部JavaScript的javascript包?
bundles.Add(new ScriptBundle("~/bundles/inte").Include(
"http://url/inte/common/js/script1.js",
"http://url/inte/common/js/script2.js",
"http://url/inte/common/js/script2.js));
答案 0 :(得分:2)
如果您使用CDN jQuery,则应启用CDN支持bundles.UseCdn = true;
public static void RegisterBundles(BundleCollection bundles)
{
bundles.UseCdn = true; //enable CDN support
//add link to jquery on the CDN
var jqueryCdnPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js";
bundles.Add(new ScriptBundle("~/bundles/jquery",
jqueryCdnPath).Include(
"~/Scripts/jquery-{version}.js"));
}