Skip to content Skip to sidebar Skip to footer

'Leave This Page' Message Display Twice On IE10

I have these line of code using onbeforeunload to ask user to save their data before closing the page. The code works well in Firefox & Chrome. window.onbeforeunload = functio

Solution 1:

Add the onbeforeunload event handler to window.href instead of window:

window.href.onbeforeunload = function () {
    if (isUpdated) {
        return "You have unsaved data";
    } else {
        return undefined;
    }
};

Post a Comment for "'Leave This Page' Message Display Twice On IE10"