Answers for "how to do html are you sure to leave"

2

javascript leave page warning

window.addEventListener("beforeunload", function (e) {
    var confirmationMessage = 'It looks like you have been editing something. '
                            + 'If you leave before saving, your changes will be lost.';

    (e || window.event).returnValue = confirmationMessage; //Gecko + IE
    return confirmationMessage; //Gecko + Webkit, Safari, Chrome etc.
});
Posted by: Guest on May-29-2020

Code answers related to "how to do html are you sure to leave"

Code answers related to "Javascript"

Browse Popular Code Answers by Language