I'm writing an application that needs to call a function when a popup has loaded. Currently, this is what I'm using, which works in Firefox/Chrome/Safari:
var win = window.open(...);
win.addEventListener( 'load', function () {...}, true );
However, opera does not like win.addEventListener
. I tried win.opera.addEventListener
too, but that also didn't help.
For the record the solution which had been found previously
var openedWindow = window.open("test.html", "title");
window.setTimeout(function() {
openedWindow.addEventListener("load", function() {
console.log("received load event");
}, false);
}, 0);