D
Daz
Hello everyone,
I would like to open a child window from the parent, and add an onload
event listener to the child window which will tell the parent when the
document has loaded. As far as I know, this shouldn't be an issue, but
I just can't get it to work. The script only needs to work with
Firefox/Mozilla, so XP code isn't an issue.
I have tried to open a window like so.
var newWindow = open('','','');
This works as expected.
Next I redirect the child window:
newWindow.location.href = 'http://www.google.co.uk';
Again, this works no problem.
before the child window is redirected, I have tried several methods of
adding an onload event listener to the window, from the script inside
the parent window, but nothing seems to work. I have tried:
newWindow.onload = windowLoaded;
newWindow.document.onload = windowLoaded;
newWindow.addEventListener('onload', windowLoaded, true);
newWindow.document.addEventListener('onload', windowLoaded, true);
None of which seem to work. Please could someone explain where I have
screwed up?
Many thanks.
Daz.
I would like to open a child window from the parent, and add an onload
event listener to the child window which will tell the parent when the
document has loaded. As far as I know, this shouldn't be an issue, but
I just can't get it to work. The script only needs to work with
Firefox/Mozilla, so XP code isn't an issue.
I have tried to open a window like so.
var newWindow = open('','','');
This works as expected.
Next I redirect the child window:
newWindow.location.href = 'http://www.google.co.uk';
Again, this works no problem.
before the child window is redirected, I have tried several methods of
adding an onload event listener to the window, from the script inside
the parent window, but nothing seems to work. I have tried:
newWindow.onload = windowLoaded;
newWindow.document.onload = windowLoaded;
newWindow.addEventListener('onload', windowLoaded, true);
newWindow.document.addEventListener('onload', windowLoaded, true);
None of which seem to work. Please could someone explain where I have
screwed up?
Many thanks.
Daz.