Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #confirm #tab #close
ADD COMMENT
Topic
Name
4+1 =