internet explorer - jQuery bind beforeunload - not working with IE 9 -


i have piece of code want fired when page closes (basically, send 'disconnected' message server. execution should fast enough me not have cancel , restart event. further that, works in chrome, firefox , safari, not in ie9 on closing tab. if navigate page in ie9, event fires. if close tab, doesn't. tried following bind code:

jquery(window).bind("beforeunload", function() { dosomework(); }); 

i tried replacing jquery $ so:

$(window).bind("beforeunload", function() { dosomework(); }); 

still works in chrome, not work in ie. suggestions?

i using jquery 1.9.1 min (compressed production version).

try this

onbeforeunload = function() {      return "are sure"; } 

tested in chrome version 26.0.1410.64 m firefox version 20.0.1 internet explorer version 9.0

fiddle


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -