opening browser...

M

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
 
S

scripts.contact

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...
}
 
S

scripts.contact

if(opener && opener.closed){
// -WINDOW CLOSED,OPEN NEW- //
}else if(!opener){
//-WINDOW CLOSED...
}


-OR-

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

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

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top