
Closing a child window when parent closes
This works, and you don't have to keep a reference to the childwin. It's important to leave off the parentheses after .close.
<HTML><SCRIPT language=JScript>function testit(){ childwin = window.open() window.onunload = childwin.close}</SCRIPT><BODY onload="testit()"></BODY></HTML>
Hi
I'm trying to simulate Netscapes "dependent=yes" feature which causes a
window created from a parent window to be automatically closed when the
parent closes.
How can I do this in Explorer. I can't figure out how to reference a child
window from the parent.
Sure I can reference it as soon as I open it:
childwin = window.open("ChildW","blah.htm")
childwin.close()
but that's not very useful.
I tried window.ChildW.close() but its says that ChildW is not an object.
same with top.ChildW.close()