Using Visual Studio 2013, I ported the Asp.Net Webforms / MVC 3 hybrid web application to Asp.Net Webforms / MVC 5.1. As part of the migration, I upgraded Jquery from 1.9.1 to 2.1.1 using the NuGet package manager.
When I run the application in the Visual Studio 2013 debugger in Chrome, I have no problem.
When I run the application in the Visual Studio 2013 debugger in IE 9 (compatible mode is not enabled), the main page with these two tags script loads first:
<script src="/Scripts/jquery-2.1.1.js" type="text/javascript"></script> <script src="/Scripts/jquery-ui-1.10.4.js" type="text/javascript"></script>
The error of this Javascript error is:
Unhandled exception at line 3425, column 4 in http://localhost:25378/Scripts/jquery-2.1.1.js 0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'addEventListener'
I understand that jQuery 2 does not work with IE 8 and below, but I can not find any documentation that notes any problems with IE 9.
Error in line 3425 jquery-2.1.1.js inside jQuery.ready.promise function:
document.addEventListener( "DOMContentLoaded", completed, false );
Oddly enough, when I stop at the error, view the document object in the debugger and expand the "Methods" node, I see the "addEventListener" method. It looks like jQuery is not allowed to see this method.
I would love to move on to jQuery 2, and from everything I read, jQuery 2 should work with IE9. Any tips to fix this problem?
Tom regan
source share