parent window know when a child window is closed

K

Kiki

Hello,
i wonder if anyone can help..
Is there a way of knowing from the parent window (var window;) that
the child window (var newWindow) has been closed? i can't touch the
child window's closed as this will be populated and managed by a
client.. i need to know when this will be closed though to reload the
parent window..

thanks
 
H

Harag

Hello,
i wonder if anyone can help..
Is there a way of knowing from the parent window (var window;) that
the child window (var newWindow) has been closed? i can't touch the
child window's closed as this will be populated and managed by a
client.. i need to know when this will be closed though to reload the
parent window..

thanks


use the .closed property.

A read-only boolean value that specifies whether the window has been
closed. When a browser window closes, the Window object that
represents it does not simply disappear. The Window object continues
to exists, but its "closed" property is set to true. (source:
Javascript: The Difinitive guide pg 653)


eg
if (newWindow.closed) {
alert('The Popup window no longer exists');
}


HTH

Al.
 
K

kiki christie

thank you for your reply Harag.. if i do it the way you suggested then i
will have to put a timer that will check every so often if the child
window has been closed..
I was just wondering if there was a better way of doing this..

thanks again..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top