I need to run ErrorEventprogrammatically, but cannot figure out how to initialize the properties of the event. Properties are read-only, and initEvent()initializes the type of event, regardless of whether it is a bubble, and if it is canceled.
I tried
var myErrorEvent = new ErrorEvent("error", new Error("This is my error"));
and
myErrorEvent.initEvent("error", false, true, new Error("This is my error"));
or
// This function would be defined in IE only. Could not find it in Chrome.
myErrorEvent.initErrorEvent("error", false, true, "This is my error", "myfile.js", 1234);
I tried many other things, but could not set properties properly ErrorEvent.
Is it possible?
source
share