onunload target

R

Robert

Hi,

I have a question of which I am not proud to ask, but there is a
deadline coming near, and it would solve most of my problems.

I want to know if a user has closed a window.
I know of the unload event, however this is triggered too when the
location changes.

I actually managed to do it in firefox, because I could see from the
event object what is the target and it is null when the document is
closed. But unfortunately the srcElement in IE6 is always null.

So could anyone help me out with a solution for IE6?

Robert
 
R

robert.waters

if you could check document.URL....

can you frame the page that the user will view? being the parent you
would know what's going on in the frame. check child.document.URL to
tell if they are where you expect them to be?
 
T

Thomas 'PointedEars' Lahn

if you could check document.URL....

You probably mean (`window.')`location'. `document.URL', if even supported,
is deprecated long since.
can you frame the page that the user will view? being the parent you
would know what's going on in the frame. check child.document.URL to
tell if they are where you expect them to be?

Using frames and thus compromising accessibility only for that is a Bad
Thing. The OP should rather reconsider the design of his application in
a way that it is not required to know when the window/tab was closed.

BTW, it was discussed here before.


PointedEars
 
R

Robert

Thomas said:
Using frames and thus compromising accessibility only for that is a Bad
Thing. The OP should rather reconsider the design of his application in
a way that it is not required to know when the window/tab was closed.

Don't worry I will. But there is not time to fix the problem in the
design for the next release. The original designer is on vacation :)
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top