jovialjonny
06-03-2003, 09:23 AM
Hi,
I am trying to open a new window from a parent window containing an HTML page I wrote. I am doing this via:
viewer = window.open("multiviewer.html");
Then (in the parent window) I am trying to append some items to the body of the newly opened page like so:
viewer.document.body.appendChild(topContainer);
The problem is it doesn't recognise the viewer.document.body because that script is executing before the new page fully loads i.e.the body does not exist yet.
Does anyone know how I can solve this? I was thinking of putting all of it in an onLoad function but I don't really know how I could do this or if it would work.
Any suggestions at all would be appreciated.
I am trying to open a new window from a parent window containing an HTML page I wrote. I am doing this via:
viewer = window.open("multiviewer.html");
Then (in the parent window) I am trying to append some items to the body of the newly opened page like so:
viewer.document.body.appendChild(topContainer);
The problem is it doesn't recognise the viewer.document.body because that script is executing before the new page fully loads i.e.the body does not exist yet.
Does anyone know how I can solve this? I was thinking of putting all of it in an onLoad function but I don't really know how I could do this or if it would work.
Any suggestions at all would be appreciated.