PDA

View Full Version : adding event "unload" doesn't work



chrizmaster
4 Aug 2009, 11:52 PM
Hi,

I nwould like to add the event "unload" to the body. But this code here doesn't work.



Ext.EventManager.addListener( document.body, "unload", function(){
alert("JOHO");
}, this);


also it doesn't work if I use beforeunload instead of unload. Anny suggestions?
Chriz

Condor
4 Aug 2009, 11:59 PM
The unload events fires on the window, not on the document.

chrizmaster
5 Aug 2009, 12:11 AM
aight,

but I recognized that the stupid Safari Browser doesn'T have such an event and I also can not add this event.

I god damn hate this cross browser thing. How good would this world be with only one browser (e.g. Firefox ;)) )

Condor
5 Aug 2009, 12:15 AM
I assume that with the introduction of browser selection during the Windows 7 installation more people will choose Chrome (simply for the Google brand). That will increase the Safari(-like) browser share.

Fortunately, more browser share also means more developers are attracted to working on it and more features will be added/fixed.