Soph
Soph

Reputation: 2915

MVC4 Unhandled Exception: Microsoft JScript runtime error

I have an application MVC4 which I just started. I run the solution and get an error:

Microsoft JScript runtime error "The object doesn't accept this property or method"

My Index.cshtml file

@{
    ViewBag.Title = "Menu Principal";
}

<h2>Home</h2>

My _Layout.cshtml

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

</head>
<body>
    @Scripts.Render("~/bundles/jquery")

    @RenderSection("scripts", required: false)

    @RenderBody()
</body>
</html>

I tagged in "razor" because all links I have seen talk about razor sections. I have taken a look into the following links which proved to help others with similar problems, but could not make it work for me:

  1. ASP.NET MVC 3: Layouts and Sections with Razor
  2. MVC 4 and Jquery tricks

I already tried:

The exact line in which it crashes, within the jquery-2.0.0.js file, is in the following one:

window.addEventListener( "load", completed, false );

Any help is much appreciated.

Upvotes: 0

Views: 469

Answers (1)

SLaks
SLaks

Reputation: 887453

You're using jQuery 2.0 on IE < 9, which it does not support.

Upgrade IE or downgrade jQuery.

Upvotes: 1

Related Questions