Microsoft JScript runtime error: 'jQuery' is undefined
I am an ASP MVC 3 noobie working my way through the music store tutorial http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-5
I have successfully added a StoreManager controller with Add/Edit/Delete operations. The controller works--I am able to perform these operations. But midway thru, visual studio shows pop ups that say "Microsoft JScript runtime error: 'jQuery' is undefined." I just ignore these errors and everything runs fine.
The SO post Updated JQuery - get Microsoft JScript runtime error: 'jQuery' is undefined seems to imply that there might be a problem with my packages.config file. Is there something I need to fix in this file to make this error go away? How can I be sure that jQuery is installed and properly hooked up to MVC3/Visual Studio? I assume that jQuery was included when installed SP1 with the MVC 3 components.
Here is my packages.config file:
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="jQuery" version="1.5.1" /> <package id="jQuery.vsdoc" version="1.5.1" /> <package id="jQuery.Validation" version="1.8.0" /> <package id="jQuery.UI.Combined" version="1.8.11" /> <package id="EntityFramework" version="4.1.10331.0" /> <package id="Modernizr" version="1.7" /> </packages>
This means that your script reference to jQuery*.js is broken, when another script tires to call jQuery this error is thrown.
If you have updated jQuery using the package manager, the version number in the reference needs to be updated. "~/Scripts/jquery-<version>.min.js"
- Make sure the path is valid.
- Make sure its the first script referenced.
- Test using Chrome/IE/FireFox debug tools
If you have master page, can you check whether any other jQuery reference is added to the content page or not? Same JQuery reference should not be duplicated.