473,406 Members | 2,705 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,406 software developers and data experts.

Can't seem to attach to "onbeforeunload" event.

I've successfully attached to the "onclick" and several other events using
AttachEvent(). But when I try to attach to the "onbeforeunload" event it
doesn't work (the handler I've assigned is never called).

Is there something different about this event?

Is there another way to attach to this event that would work, other than
manually filling in the <BODY> tag with an 'onunloadbefore' assignment?

thx

--

Robert Oschler
Jul 20 '05 #1
1 3864
"Robert Oschler" <no_replies@fake_email_address.invalid> wrote in message
news:fz****************@news2.news.adelphia.net...
I've successfully attached to the "onclick" and several other events using
AttachEvent(). But when I try to attach to the "onbeforeunload" event it
doesn't work (the handler I've assigned is never called).

Is there something different about this event?

Is there another way to attach to this event that would work, other than
manually filling in the <BODY> tag with an 'onunloadbefore' assignment?


window.attachEvent("onbeforeunload",functionname)

Jul 20 '05 #2

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

Similar topics

2
by: Robert Oschler | last post by:
I have a web page where I want to make sure that an image HTTP request is successfully made before the page unloads. The request is made by setting the image element's SRC property to the desired...
2
by: Mozzie ³ | last post by:
Can 'onbeforeunload' (ie) be used to trigger a javascript? I can't find any info on how or if this is possible. Regards.
6
by: Marcia Gulesian | last post by:
What code can I put in the 'onbeforeunload' event to cancel the 'unload' action (when user closes browser) and then present the user with an alert saying that he/she must use the logout button.
1
by: RJN | last post by:
Hi I have a pop-up window which has a task menu on its left which are nothing but links to different screens. This window also has a close button. On click of close button I do some server side...
2
by: Vladimir | last post by:
It appears that this event (window.onbeforeunload) does not fire at least in Netscape 7.0 and 7.1. But window.onload and window.onunload events do! I really need this event handling in my...
3
by: sowencheung | last post by:
I attach an Event in document.onkeyup and another event in document.onbeforeunload in onkeyup event, if the condition is satisfied, i will activate sth, then i don't want the onbeforeunload...
1
by: lee_youjin | last post by:
I needed to defect when the user is clicking the IE X button ( top right). so I could execute the cleanup function. I was able to detect it using onbeforeunload event. Now I need to call the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.