Closing a child window when parent closes 
Author Message
 Closing a child window when parent closes

childwin = showModelessDialog ...
childwin.opener = window

Now childwin will go away with it's parent.

Eric K.

  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()



Mon, 29 Jul 2002 03:00:00 GMT  
 Closing a child window when parent closes
Hello,

onunload='w.close();' ?

Regards,
Armand, FTSB


Quote:
> 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()



Mon, 29 Jul 2002 03:00:00 GMT  
 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()



Mon, 29 Jul 2002 03:00:00 GMT  
 Closing a child window when parent closes
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()



Tue, 30 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Close all child windows when parent is closed

2. Updating parent window and closing child window

3. Updating parent window and closing child window

4. Getting a Child window to Refresh its Parent when its closed

5. Updating a parent window and closing the child

6. Call function in parent window, then close child (current)

7. closing a popup when the parent closes.

8. Close child window when another window becomes active

9. Refreshing a parent window after closing link window

10. Problems Closing a New Window using window.close()

11. detect closing child browser window

12. how to close the grand-child window?

 

 
Powered by phpBB® Forum Software