I also came across this in Safari, I used the try / catch instruction to use the constructor without the obsolete ones, when possible, but do not execute the old one if necessary.
jGp.evt = new Object();
try {
jGp.evt.erro = new Event("jGp_evtErro");
}
catch (e) {
jGp.evt.erro = document.createEvent('Event');
jGp.evt.erro.initEvent("jGp_evtErro", true, true);
}
source
share