Answers for "js ask before close"

1

js ask before close

window.onbeforeunload = function() {
        return "";
  }
Posted by: Guest on May-16-2020
2

javascript confirm tab close

<script>
window.onbeforeunload = function (e) {
    e = e || window.event;

    // For IE and Firefox prior to version 4
    if (e) {
        e.returnValue = 'Sure?';
    }

    // For Safari
    return 'Sure?';
};
</script>
Posted by: Guest on February-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language