[RESOLVED]Object doesn't support property or method 'addEventListener' — ONLY IN IE 10

Hi,

I am having an mvc application in .net framework 4.5

I am referring the scripts as follows

@{
    string hostUrl = OLR.STRAC.UI.WEB.Models.TrackerModel.GetRedirectionURL();
    <script src="~/Scripts/jquery-1.8.0.min.js"></script>
    <script src="@Url.Content(hostUrl+"Scripts/jquery-2.1.1.js")"></script>
    <link href="@Url.Content(hostUrl+"Css/Admin.css")" rel="stylesheet" />
     <script src="@Url.Content(hostUrl+"Scripts/jquery-ui.js")"></script>
    <link href="@Url.Content(hostUrl+"Css/jquery-ui.css")" rel="stylesheet" />
    
}

But I am getting the following error onLoad of the view

Unhandled exception at line 3425, column 4 in http://localhost:58337/Scripts/jquery-2.1.1.js

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'addEventListener'

This error I am getting only in IE 10

Please help me

Thanks,

Vidya

Vidya001

But I am getting the following error onLoad of the view

Unhandled exception at line 3425, column 4 in http://localhost:58337/Scripts/jquery-2.1.1.js

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'addEventListener'

This error I am getting only in IE 10

AFAIK Jquery 2.1.1 version should work fine above IE 8 versions. Please check In your code are forcing the IE 10 broswer to load in IE 8 mode by using the below line of code

<meta http-equiv="X-UA-Compatible" content="IE=8">

if so then remove the above line.

Hi Vidya001,

According to your post ,it seems that you have add jquery 1.8.0 and jquery 2.1.1 two version in the same page.

As far as I know,the 2.x series of jQuery support IE 10.

So I suggest that you can remove the code in your page below :

Vidya001

<script src="~/Scripts/jquery-1.8.0.min.js"></script>

Best Regards,

Kevin Shen.

Leave a Reply