On Mar 5, 2:43 pm, "Mel" <MelHer...@gmail.comwrote:
My main window pops a "remove control" window from which user clicks
on links that are displayed in parent window.
users however have a tendency of closing the parent window. How can i
check the existance of the parent window and if it does not exist open
a new one ?
thanks to all
window.opener returns the window that opened the current window so
check if window.opener is null or not.
Example :
if(!window.opener){ //-WINDOW CLOSED, Open NEW// }
But i tested this in IE and window.opener returns the window object
even when the parent window is closed (someone correct me if this is
wrong) so check for window.opener then check for
window.opener.closed :
if(opener && opener.closed){
// -WINDOW CLOSED,OPEN NEW- //
}else if(!opener){
//-WINDOW CLOSED...
}