Check out the following code snippet that is functional.
window.onbeforeunload = function() {
someAjaxCall();
}
This code block, however, does not perform as expected:
window.onbeforeunload = function() {
someAjaxCall();
alert("Success !!");
}
Is it possible to include alerts in onbeforeunload?