Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

preventClosingTab

<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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript covert html characters to text 
Javascript :: Line logger 
Javascript :: e.stopPropagation() is not working as expected 
Javascript :: react Update a label when rate moves "quietly" 
Javascript :: Refresh a kendo ui widget, when options on AngularJS $scope change 
Javascript :: Uploading profile pic with react.js node.js express.js REST API to sqlite DB 
Javascript :: dsicrod.js bot answer to himself 
Javascript :: How to check for the properties of an element in the console 
Javascript :: how to translate the title in js file in magento 2 
Javascript :: POST http://localhost:3000/$(process.env.REACT_APP_API_URL)/auth/users/ 404 (Not Found) in react redux 
Javascript :: dev console with colored font 
Javascript :: map vs subscribe angular 
Javascript :: mdn spread 
Javascript :: svelte json 
Javascript :: ex:h2p 
Javascript :: filter-vs-map-reactjs-and-jsx 
Javascript :: o que e window.onload js 
Javascript :: flash effect in react native 
Javascript :: how to give id dynamically in javascript 
Javascript :: window location host vs origin 
Javascript :: tower defense bullet following enemy with range javascript 
Javascript :: variables are used to store data values. 
Javascript :: react and express 
Javascript :: asynchronous file read 
Javascript :: everything about fetch 
Javascript :: momentjs isomonth 
Javascript :: sqlite get row id after insert nodejs 
Javascript :: see more in jquery 
Javascript :: change previous location history javascript 
Javascript :: Wikibreak enforcer 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =