In my chat application I need to get confirmation from user , when my application closes.
So I used the window.onbeforeunload for confirmation alert and
window.onbeforeunload
I was able to get it to work in IE and FF with jQuery's:
$(window).bind('beforeunload', function(){ });
instead of: unload, onunload, or onbeforeunload