473,396 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

onunload target

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
Nov 11 '05 #1
3 2712
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?

Nov 11 '05 #2
ro***********@gmail.com wrote:
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
Nov 11 '05 #3
Thomas 'PointedEars' Lahn wrote:

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 :)
Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ric Castagna | last post by:
I have a form that I'm trying to handle if the viewer "leaves" without completing the entire thing. The client wants to be advised that someone one "tried" to fill out the application. Most...
2
by: Simon Wigzell | last post by:
I'm using OnUnLoad in my body statement to redirect to a function to clean things up if someone exits a form by closing it from outside the webpage code - e.g. by not using the cancel or save and...
6
by: kaeli | last post by:
Hey guys, This error occurs ONLY in Netscape 7.0. Not in 7.1. So, I think it's a bug. Buuuut... Has anyone had this problem or know of a fix? When attempting to have an onunload function...
3
by: Laurent | last post by:
I am trying to use the onunload event to know when the user closes a popup by receiving a request on the web server. I have a main page from where the user opens a popup. What I want is when the...
1
by: Tim Arview | last post by:
Hi, I'm trying to create an exit popup that doesn't require anything added to the body tag. In other words, I don't want to say <body onunload="foo">. I just want to have window.onunload="foo"...
3
by: ccyarm | last post by:
Hello, I need to modify the following code to make it work with Firefox. It works perfectly well with IE. It seems to me that with Firefox all the form values are lost when the onUnload fires up. ...
0
acoder
by: acoder | last post by:
Problem onload and onunload events do not fire when going back, forward or refreshing the page Browser Opera Example Any code using onload or onunload, e.g. window.onload = init; where...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.