faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

16 of 42 people (38%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

Can I customize onbeforeunload event?

Apr 6th, 2008 19:59
ha mo, Jean-Bernard Valentaten, Colin Fraser, Milko Gonzalez,


Colin wrote:
> I have gone over the latest documentation I have but I can not find an
> event called onbeforeunload, I have an onUnload, is this a custom 
> event? 
> More than likely, there is no such event. How could there be? 
> Logically the stateless connectivity of web browsers implies that 
> events cannot be trapped until they have been initiated, so how can 
> an event be trapped before it is intiated? Javascript is purely 
> reactionary. You sure you are not confusing Visual Basic or Java with 
> Javascript?
> If I am wrong, then please accept my apologies, but I have no
> documentation about such an event..
Well, the idea is correct (how can an event be triggered, before it is 
fired), but onBeforeUnload does really exist. It is not well 
documented, but searching msdn brings this page up:
http://msdn.microsoft.com/library/default.asp?
url=/workshop/author/dhtml/reference/events/onbeforeunload.asp
Hope this helps you out Milko.
Jean
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com