Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery not working with IE 11

Object doesn't support property or method 'addEventListener'

'jQuery' is undefined  

I'm using IE 11,

/jquery-2.1.1.min.js

jquery-migrate-1.1.1.js

and jquery-ui-1.11.0.custom/jquery-ui.js (theme roller)

Before 2.1.1, i was using 1.11.1 with chrome (worked fine)

I have tried this fix but it did not work for me

like image 203
Simon. Avatar asked Aug 01 '14 09:08

Simon.


People also ask

Does IE 11 support JavaScript?

Internet Explorer 11 doesn't support JavaScript versions later than ES5. If you want to use the syntax and features of ECMAScript 2015 or later, or TypeScript, you have two options as described in this article. You can also combine these two techniques.

Does jQuery work on IE?

If you need to support older browsers like Internet Explorer 6-8, Opera 12.1x or Safari 5.1+, use jQuery 1.12.


2 Answers

As Arnaud suggested in a comment to the original post, you should put this in your html header:

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

I don't want any cred for this. I just want to make it more visible for anyone else that come here.

like image 162
Conny Olsson Avatar answered Sep 28 '22 04:09

Conny Olsson


The problem was caused because the page was an intranet site, & IE had compatibility mode set to default for this. IE11 does support addEventListener()

like image 40
T J Avatar answered Sep 28 '22 05:09

T J