0

I have downloaded Visual Studio 2015 Community edition. I have tried to create an MVC project. I have gone through his process:

1) File/New Project/ - C# ASP.NET
2) Select MVC project
3) Project is created
4) Build and click debug

The error I get is this: "0x800a1391 - JavaScript runtime error: 'jQuery' is undefined" Error. I have downloaded Visual Studio 2013 Community edition and followed the instructions above and I am prompted with the same error.

I found this: https://www.youtube.com/watch?v=_yrwhqoT1Bg. I followed the instructions expect I specified: @Scripts.Render("~/Scripts/jquery-1.10.2.min.js") as jquery-1.8.2.min.js does not exist, but jquery-1.10.2.min.js does. I am prompted with the same error after doing this.

What is the problem? This is a new project. I have added nothing.

1 Answer 1

1

It seems that @Scripts.Render("~/Scripts/jquery-1.10.2.min.js") doesn't exist

Just render the script this way

@Scripts.Render("~/bundles/jquery")

and make sure that you have it in your BundleConfig.cs this way

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

Also, if you are using IE browser, then try to use the latest version of JQuery, as the JQuery has some compatibility issues with the IE

Sign up to request clarification or add additional context in comments.

3 Comments

bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js")); already exists in the BundleConfig class. I have added: @Scripts.Render("~/bundles/jquery") to _Layout.cshtml and it has made no difference. Have I followed your instructions correctly?
Are you using IE as your browser? If so, try to use the latest version of JQuery, sometimes its related to the compatibility of JQuery with different browsers
Interesting. It works in Firefox, but not in IE11. Can you make a change to your answer because it is saying I downvoted it (which must have been by mistake). I will upvote it for the browser comment. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.