Javascript adding onload to popup

I am trying to add an onload event to a popup like this:

var explorerWindow = window.open(PARAMS...);
explorerWindow.onload = function() {window.opener.unlockObj(id);}

The idea is to make a button that generates a readonly popup that makes it usable again when the popup has loaded all its contents. However, this event does not seem to shoot at all. I even changed it to the following and received nothing:

explorerWindow.onload = function() {alert("bloop");}

Is there something terribly wrong in my syntax, or am I missing something at all? In addition, I use jQuery if there are any suitable stones that will help in this situation. I tried the following with similar results, but I'm not sure I got the correct call:

$(explorerWindow).load(function() {alert("bloop");});

Any help is greatly appreciated.

+5
2

. onload , , :

window.onload = function() {
    opener.doStuff();
}
+1

, , :

explorerWindow.onload = new function() { explorerWindow.opener.unlockObj(id); }

, .

-1

All Articles