469,623 Members | 994 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

opening browser...

Mel
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

Mar 5 '07 #1
2 1221
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...
}

Mar 5 '07 #2
On Mar 5, 2:43 pm, "Mel" <MelHer...@gmail.comwrote:
if(opener && opener.closed){
// -WINDOW CLOSED,OPEN NEW- //
}else if(!opener){
//-WINDOW CLOSED...
}

-OR-

if(!opener || opener.closed){
//-WINDOW CLOSED-//
}

Mar 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by D. Alvarado | last post: by
8 posts views Thread by Vigneshwaran G via DotNetMonster.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.