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"