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

R

Robert Oschler

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
 
V

Vjekoslav Begovic

Robert Oschler said:
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)
 

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,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top