IE 9 Script error SCRIPT438: Object doesn't support property or method 'addEventListener'
Asked Answered
T

4

9

I have a jQuery popup window that works in Firefox.

However, I am getting the following error message on line 1 of my html page:

SCRIPT438: Object doesn't support property or method 'addEventListener' popup_1.html, line 1 character 1

The only code I have in line 1 is:

<html>

When I run the IE9 debugger, I am getting an error on something called

script block(1)

But I am not using any javascript named "script block" is this an Internet Explorer add on or something?

Tullus answered 21/11, 2011 at 21:38 Comment(0)
T
13

Looks like I had to add the html 5 doctype:

<!DOCTYPE html>
Tullus answered 21/11, 2011 at 21:41 Comment(0)
P
6

I got this error in IE10. The issue was the browser was running in compatibillity mode. Hit F12 and turn it off. The error is gone.

enter image description here

Pastime answered 8/4, 2014 at 19:59 Comment(1)
I also set Document Mode to StandardsTradein
V
5

Adding the following tag solved this issue for me:

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

This error usually happens because IE creates JS variables for every HTML node and it conflicts with jQuery & other JS things you're adding.

Volk answered 2/12, 2015 at 9:41 Comment(0)
I
1

Make sure you have the following tags:

  1. <!DOCTYPE html> (and, of course, close this tag too)
  2. <meta http-equiv="X-UA-Compatible" content="IE=edge" />

Both these tags tell IE to render the page using Edge, the latest renderer.

Ike answered 4/10, 2016 at 22:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.