Debt Consolidation - Debt Consolidation - Car Insurance Quotes - Chants - Myspace Layouts

PDA

View Full Version : Check if the child window is open from parent window


magnon
Feb 15th 2009, 8:22 pm
Hi,

how can I check if the child window i created is still active or if it is closed?
hopefully that it would work on IE and FF

gnp
Feb 16th 2009, 9:17 am
when you create it you need to assign the window object to a variable


var win = window.open(.....);


now, since you have a reference to the window object, you can check the property closed

if (win.closed)
alert('closed');
else
alert('still open');


ref: http://www.w3schools.com/htmldom/dom_obj_window.asp

hope this does the trick for you ;)