Internet Explorer 9, 10 & 11 Event constructor doesn't work -


I am creating an event, so use the DOM Event Builder:

  New Event ('change');  

It works fine in modern browsers, though Internet Explorer 9, 10 & amp; 11, it fails with:

  object does not support this action  

How can I fix Internet Explorer (ideally Through a polyphil)? If I can not, can I use a workaround?

There is one. Adding CustomEvent to IE and working instead.

  (if (typeof window.CustomEvent === "function") return false; // If not IE function CustomEvent (event, parameters) {params = params || {Bubbles: false, cancellable: false, expansion: undefined}; var evt = document.createEvent ('CustomEvent'); evt.initCustomEvent (event, parameter.bubble, parameter.conable, parameter.detail); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent;}) ();  

Comments