Javascript appending onload to a popup window

Posted by Hypnotic Meat on Stack Overflow See other posts from Stack Overflow or by Hypnotic Meat
Published on 2010-04-16T14:53:04Z Indexed on 2010/04/16 15:23 UTC
Read the original article Hit count: 237

Filed under:
|
|

I'm trying to append an onload event to a popup window in the following manner:

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

The idea is to make the button that generates the popup window readonly, making it usable again once the popup window has loaded all of its contents. However, the event doesn't seem to be firing at all. I even changed it to the following and got nothing:

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

Is there something terribly wrong with my syntax or am I missing something else entirely? Also, I'm using JQuery if there are any appropriate gems there that will help in this situation. I tried the following with similar results, but I'm not so sure I got the call right:

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

Any help is greatly appreciated.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery