由于某种原因,我得到1.8.2版本的jQuery添加到我的解决方案,即使没有参考它的任何地方。脚本中只有1.9.1。添加它的代码是:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js"));
一切似乎都很顺利。我在控制台中也有这些错误。什么好主意吗?
Exception was thrown at line 5288, column 6 in http://xxx:7000/Scripts/jquery-1.8.2.js
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 4224, column 4 in http://xxx:7000/Scripts/jquery-1.9.1.js
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 4242, column 4 in http://xxx:7000/Scripts/jquery-1.9.1.js
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 5288, column 6 in http://xxx:7000/Scripts/jquery-1.8.2.js
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 4224, column 4 in http://xxx:7000/Scripts/jquery-1.9.1.js
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 4242, column 4 in http://xxx:7000/Scripts/jquery-1.9.1.js
0x800a139e - JavaScript runtime error: SyntaxError
看一下下面的代码
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
把所有版本的jquery在你的文件夹,并把它放在页面或视图,你叫它,例如在布局页面,所以你必须删除一个jquery文件,例如jquery-1.8.2.js或jquery-1.9.1.js从你的项目的脚本文件夹它认为它应该对你有用
确保在发布时更改设置以删除目标中的所有文件…