curen
06-05-2003, 10:45 AM
Hi,
I open a new window with the following code:
newwin = window.open('NewWindow.htm', 'newwin','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=670,height=450,l eft = 100,top = 50');
setTimeout("newwin.focus();",500);
setTimeout("newwin.opener=self",500);
setTimeout("newwin.main.location= 'Example.htm",1000);
setTimeout("newwin.footer.location = 'Example2.htm'",1000);
I have used setTimeout everywhere to allow for the time it takes for the window to open.
However I still have problems sometimes on the following line:
setTimeout("newwin.main.location= 'Example.htm",1000);
where it is saying newmain.main is null or not an object.
What I am assumming is happening is that the window has been opened but the frameset has not had sufficient time to load.
Hence I need to be sure the frameset exists before trying to load a page into it.
However, I cannot just use a loop checking the value because this will use precious CPU time and slow the loading of the frameset even more. I also cannot just keep increasing the setTimeout value as I can never be sure it will work in all situations.
Does anyone have any other suggestions about how to get round this.
Thanks
Chris
I open a new window with the following code:
newwin = window.open('NewWindow.htm', 'newwin','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=670,height=450,l eft = 100,top = 50');
setTimeout("newwin.focus();",500);
setTimeout("newwin.opener=self",500);
setTimeout("newwin.main.location= 'Example.htm",1000);
setTimeout("newwin.footer.location = 'Example2.htm'",1000);
I have used setTimeout everywhere to allow for the time it takes for the window to open.
However I still have problems sometimes on the following line:
setTimeout("newwin.main.location= 'Example.htm",1000);
where it is saying newmain.main is null or not an object.
What I am assumming is happening is that the window has been opened but the frameset has not had sufficient time to load.
Hence I need to be sure the frameset exists before trying to load a page into it.
However, I cannot just use a loop checking the value because this will use precious CPU time and slow the loading of the frameset even more. I also cannot just keep increasing the setTimeout value as I can never be sure it will work in all situations.
Does anyone have any other suggestions about how to get round this.
Thanks
Chris