Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

confirm closing tab

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?';
};

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #confirm #closing #tab
ADD COMMENT
Topic
Name
6+1 =