最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error with jquery references and getting two versions of jquery at once - Stack Overflow

programmeradmin0浏览0评论

For some reason I am getting version 1.8.2 of jQuery added to my solution even though there is no reference to it anywhere. Only 1.9.1 in the scripts. The code to add it is:

bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js"));

Things seem to work fine. I also have these errors in the console. Any ideas?

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

For some reason I am getting version 1.8.2 of jQuery added to my solution even though there is no reference to it anywhere. Only 1.9.1 in the scripts. The code to add it is:

bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js"));

Things seem to work fine. I also have these errors in the console. Any ideas?

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
Share Improve this question edited Jan 9, 2014 at 21:38 abatishchev 100k88 gold badges301 silver badges442 bronze badges asked Apr 29, 2013 at 16:54 punkouterpunkouter 5,36617 gold badges78 silver badges123 bronze badges 3
  • 1 "even though there is no reference to it anywhere" There is somewhere, but where??? – A. Wolff Commented Apr 29, 2013 at 16:57
  • 1 Look at this answer: stackoverflow./questions/14412221/… – Niels Commented Apr 29, 2013 at 16:58
  • a migration tool is needed to move to a new version of jquery? I thought that is what nugget was there fore.. update the jquery version in nugget and done ? – punkouter Commented Apr 29, 2013 at 18:54
Add a ment  | 

2 Answers 2

Reset to default 6

Take a look to the following code in the code bellow

 bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                "~/Scripts/jquery-{version}.js"));

take all of the versions of the jquery in you folder and put it in the page or view where you call it e.g in Layout page so you have to delete one of the jquery file , e.g jquery-1.8.2.js or jquery-1.9.1.js from the scripts folder of your project it think it should work for you

Make sure that when you publish, you change your settings to remove all files at destination...

发布评论

评论列表(0)

  1. 暂无评论