我通过nuget管理器下载了jQuery UI并将其添加到我的bundleconfig中,之后我遇到了这个错误。请看下面的图片。
BundleConfig.cs
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jQuery/jQuery-2.1.4.min.js",
"~Scripts/jquery-ui.min.js",
"~/Scripts/Bootstrap/js/bootstrap.min.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/jquery.validate.unobtrusive.js",
"~/Scripts/CustomJs/masterpage.js"
));
答案 0 :(得分:2)
更改此
`bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jQuery/jQuery-2.1.4.min.js",
"~Scripts/jquery-ui.min.js",
"~/Scripts/Bootstrap/js/bootstrap.min.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/jquery.validate.unobtrusive.js",
"~/Scripts/CustomJs/masterpage.js"
));`
到这个
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jQuery/jQuery-2.1.4.min.js",
"~/Scripts/jquery-ui.min.js",
"~/Scripts/Bootstrap/js/bootstrap.min.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/jquery.validate.unobtrusive.js",
"~/Scripts/CustomJs/masterpage.js"
));
就行" ~Scripts / jquery-ui.min.js",你错过了/和〜之间的脚本
答案 1 :(得分:1)
您应该像这样添加它。你错过了路径中的a / after~。
"~/Scripts/jquery-ui.min.js",
答案 2 :(得分:1)
`bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jQuery/jQuery-2.1.4.min.js",
**"~Scripts/jquery-ui.min.js",** Wrong here
"~/Scripts/Bootstrap/js/bootstrap.min.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/jquery.validate.unobtrusive.js",
"~/Scripts/CustomJs/masterpage.js"
));
更改为
`bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jQuery/jQuery-2.1.4.min.js",
**"~/Scripts/jquery-ui.min.js",** correct
"~/Scripts/Bootstrap/js/bootstrap.min.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/jquery.validate.unobtrusive.js",
"~/Scripts/CustomJs/masterpage.js"
));