MouseEvent not working in Internet Explorer

后端 未结 3 1678
你的背包
你的背包 2020-12-10 11:20

Is it me? Is it my IE? or why is this code not working on IE 11:

var clicker = new MouseEvent(\"click\", {
  \'bubbles\': true,
  \'cancelable\': true,
  \'v         


        
3条回答
  •  轮回少年
    2020-12-10 12:17

    There is a polyfill to make it work in IE.

    Except that the try catch block in that code needs to look like this:

    try {
      new CustomEvent('test');
      return false; // No need to polyfill
    } catch (e) {
      // Need to polyfill - fall through
    }
    

    I submitted this correction to their website.

提交回复
热议问题