Search code examples
jqueryauthenticationasp.net-mvc-4windows-server-2008windows-authentication

jQuery is Undefined, json is undefined, 'fn' is null or not an object


I recently updated the jQuery, unobtrusive ajax and all other libraries in my ASP.net MVC4 website. Things were working pretty fine till Friday both on localhost as well as on server but now I'm totally stuck in so many weird errors.

Errors
1. Localhost not resolving to 127.0.0.1: I have no idea what made this change but now everytime I press "Run" button from Visual Studio, browser does not open http:localhost:53381 link instead it always goes to http://173.6.120.31/ - which in fact gets nothing. Just "operation time out" error after some time.

If I enter http://127.0.0.1 in browser manually then website works.
2. jQuery, json scripts are not published to the server When I publish website to server and try to access site from any browser on my system then site works properly. However on any other system, all jQuery related components has stopped working in Internet explorer.

It throws 'JQuery is undefined', Json is undefined etc errors on html page.

I googled more about it and found that it could be the windows authentication culprit here. We are using Windows authentication and there are two types of authentication mechanism i.e. Negotiate and NTLM.

Not sure if removing Negotiate can fix this but this issue has totally stopped my development.

Here is the snapshot of fiddler while accessing the site from server. **Strange things: script files first report "User authentication problem" then download successfully again

enter image description here Thanks in advance.


Solution

  • Solved by deleting all browsing history and removing @Scripts.Render("~/bundles/jqueryval") from the Layout file.