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

﹥>﹥吖頭↗ 提交于 2019-12-08 16:03:33

问题


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?


回答1:


Looks like I had to add the html 5 doctype:

<!DOCTYPE html>



回答2:


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.




回答3:


Adding

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

solved this issue for me.

This error usually happens because IE create js variables for every html node and it conflicts with jquery & other JS things you're adding.




回答4:


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.



来源:https://stackoverflow.com/questions/8218894/ie-9-script-error-script438-object-doesnt-support-property-or-method-addevent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!