Skip to main content

Bug Tracker

Side navigation

#10509 closed bug (cantfix)

Opened October 17, 2011 08:20AM UTC

Closed November 15, 2011 02:24PM UTC

Last modified December 03, 2012 10:09AM UTC

JQUERY UNLOAD DOESN'T WORK IN GOOGLE CHROME 14 AND ABOVE!

Reported by: bistra Owned by:
Priority: low Milestone: None
Component: event Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:
Description

JQUERY UNLOAD DOESN'T WORK IN GOOGLE CHROME 14 AND ABOVE!

For example this:

$(window).unload(function(){

alert("Goodbye!");

});

doesn't produces anything!

It crashes totally my project! Help me, please!

Attachments (0)
Change History (4)

Changed October 17, 2011 11:54AM UTC by addyosmani comment:1

component: unfiledevent
priority: undecidedlow
status: newopen

Confirmed that this works in FF.latest but not in Chrome 14+: http://jsfiddle.net/BT3SS/1/. Pretty sure this is a dupe of another ticket, but will chase down and confirm. I do know there are known issues with onbeforeunload in Chrome.stable onwards, but need to find out if there are related ones with this.

Changed November 15, 2011 02:24PM UTC by dmethvin comment:2

resolution: → cantfix
status: openclosed

Not our bug, and something we can't patch.

http://code.google.com/p/chromium/issues/detail?id=91854

Several dups in their bug database, search for "onunload" to see them.

Could be related to this security fix since it arose at Chrome 14:

http://xforce.iss.net/xforce/xfdb/69872

Changed April 02, 2012 04:53PM UTC by anonymous comment:3

It has a solution:

window.onbeforeunload = function() { return "text"; }

It's not a jQuery code, but it works.

Changed December 03, 2012 10:09AM UTC by anonymous comment:4

The solution mentioned above:

window.onbeforeunload = function() { return "text"; }

does not work either for me if I close the respective window. It works if I reload the page.