[Javascript] Can a reloaded parent window close its child?

Paul Novitski javascriptlist at dandemutande.org
Sat Dec 27 01:41:01 CST 2003


I want my browser window to create a child window that says "Please wait" 
while the parent window is reloading.  Unfortunately, when the parent has 
reloaded, it appears to have forgotten the identity of the child:

body onLoad="jsCloseChild();" onUnLoad="jsCreateChild();"

The close function fails when I use either of these two techniques for 
creating and naming the child:

=====================================
function jsCreateChild(){
	window.open('PleaseWaitChild.html', 'MyChild', '');
}
function jsCloseChild(){
	MyChild.close;
}
=====================================
var MyChild;
function jsCreateChild(){
	MyChild=window.open('PleaseWaitChild.html', 'WindowName', '');
}
function jsCloseChild(){
	MyChild.close;
}
=====================================
Can anyone provide a solution?

Thanks,
Paul





More information about the Javascript mailing list