143
rated 0 times
[
144]
[
1]
/ answers: 1 / hits: 18929
/ 13 Years ago, tue, december 20, 2011, 12:00:00
I'm developing one of those warning windows that tells the user that they may have unsaved data, but I only need it to warn them if they're leaving the page. Currently it does so on refreshes, postbacks, etc. I was wondering if there was any way to tell how the page was unloaded or otherwise get more details about what the user is doing to unload the page. (jquery solutions welcome).
Code for reference:
window.onbeforeunload = function () {
if (formIsDirty) {
formIsDirty = false;
return Are you sure you want to navigate away from this page?;
}
}
More From » jquery