Bug Tracker

Changes between Initial Version and Version 2 of Ticket #1365


Ignore:
Timestamp:
Jul 15, 2007, 10:13:35 AM (13 years ago)
Author:
john
Comment:

returnValue is an IE specific feature - what if you just do:

$(window).bind("beforeunload"), function(){

return "Quit without saving?";

});

However, the problem is much larger than that - the beforeunload event ONLY works if you directly access the window object and do:

window.onbeforeunload = function(){ ... };

For example, opening a browser and doing:

window.addEventListener('beforeunload',function(){

return "test";

});

You'll find that it doesn't work, so we won't be able to do anything to help the situation. (So in this case, I recommend that you fall back to the traditional way of doing things.)

Legend:

Unmodified
Added
Removed
Modified