Skip to content Skip to sidebar Skip to footer

0x800a1391 - Javascript Runtime Error: 'jquery' Is Undefined

I have a ASP .Net MVC4 Web application. In it I have my usual html for the _Layout.cshtml, which in turn loads the default Home/Index. All works fine. In my index I am also loading

Solution 1:

Try setting the src for jQuery to be absolute from the site root:

<scriptsrc="/assets/plugins/jquery-1.8.3.min.js"type="text/javascript"></script>

Note the / before assets - when your src path does not start with a / the browser will try and load the asset relative to the current path, so in your example when you add the trailing slash to Home it will try to load jQuery from Home/assets/plugins/...

Solution 2:

For me, the MVC bundlers were causing problems (in my case the ui bundler)

Here is the order which worked for me.

<scriptsrc="/Scripts/modernizr-2.5.3.js"></script><scriptsrc="/Scripts/jquery-1.7.1.js"></script><scriptsrc="/bundles/jquery-ui"></script><scriptsrc="/Scripts/jquery.unobtrusive-ajax.js"></script><scriptsrc="/Scripts/jquery.validate.js"></script><scriptsrc="/Scripts/jquery.validate.unobtrusive.js"></script>

Solution 3:

You need to add the jquery-x.xx.x.js first before the validate.js like this

<scriptsrc="~/Scripts/jquery-1.10.2.js"></script><scriptsrc="~/Scripts/jquery.validate.js"></script>

Post a Comment for "0x800a1391 - Javascript Runtime Error: 'jquery' Is Undefined"