Detecting closed parent window from popup

R

Robert Dickow

I have a little bit of code in a popup window that attempts to detect
when the parent window is closed or rather just jumped to another page
url.

the expression below is used in a popup created from a frame in the
parent window:

self.opener.closed

This yields 'false' while the parent is opened. The problem is, it
always gives a 'false' even if the parent window moves to another url.
However, if the browser is closed then the expression yields 'true'.

What approach should I use to determine if the parent window from
which the popup is called is changed or closed?
 
F

Fabian

Robert Dickow hu kiteb:
I have a little bit of code in a popup window that attempts to detect
when the parent window is closed or rather just jumped to another page
url.

the expression below is used in a popup created from a frame in the
parent window:

self.opener.closed

This yields 'false' while the parent is opened. The problem is, it
always gives a 'false' even if the parent window moves to another url.
However, if the browser is closed then the expression yields 'true'.

What approach should I use to determine if the parent window from
which the popup is called is changed or closed?

You could check to see the url contained within the parent window. If it
returns one of yours, you can probably assume it hasn't been changed or
closed.

If the guy disconnects while on your page, all bets are off as to
whetehr your function will work as intended.
 

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,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top