对象不支持使用CustomEvent Initialization的此操作IE9 [英] Object doesn't support this action IE9 with CustomEvent Initialization
问题描述
我在IE9中收到以下错误:
I am getting the following error in IE9:
对象不支持此操作。
关于这个有各种各样的问题,但是我的具体代码如下:
There are various question about this, but mine is specifically for the following code:
var myEvent = new CustomEvent("additem");
据我了解,IE9支持CustomEvent作为DOM操作命令。这在Chrome中运行良好,没有任何例外。
From my understanding, CustomEvent is supported in IE9 as a DOM manipulation command. This works fine in Chrome without any exception.
任何人都有这个问题,知道如何解决它?谢谢。
Anyone has this problem and know how to solve it? Thanks.
推荐答案
IE浏览器不支持Afaik自定义事件,仅限普通浏览器。我建议使用一个javascript库来提供像Jquery触发器这样的浏览器独立实现: http://api.jquery.com/trigger/
Afaik custom events are not supported in IE, only in normal browsers. I suggest using a javascript library that provides a browser independent implementation like Jquery's trigger: http://api.jquery.com/trigger/
这篇关于对象不支持使用CustomEvent Initialization的此操作IE9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!