Here is the beforeunloadevent that fires when the page breaks (either follow the link, or if the window closes, or update, etc.). Example:
window.onbeforeunload = function(event) {
var s = "You have unsaved changes. Really leave?";
event = event || window.event;
if (event) {
event.returnValue = s;
}
return s;
}
, beforeunload, , , beforeunload , . , , . , , , .
:
, ajax- ...
, ajax (async: false) , . , , (, ), . ( ), . , , (, ..).
, async jQuery (ticket), , 1.8 1.9, - .