Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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.
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: js canvas triangle 
Javascript :: react create app 
Javascript :: install react 
Javascript :: 50 50 chance javascript 
Javascript :: blacklisted word discord.js 
Javascript :: javascript check if object is empty 
Javascript :: js remove undefined from array 
Javascript :: javascript math.random from list 
Javascript :: get height use js 
Javascript :: npm ERR! Fix the upstream dependency conflict, 
Javascript :: how to check if a string has only alphabets in javascript 
Javascript :: check if path is folder js 
Javascript :: update nodejs 
Javascript :: sort object alphabetically javascript 
Javascript :: jquery prevent event bubbling 
Javascript :: v-for i down 
Javascript :: js current time 
Javascript :: oncheck event jquery 
Javascript :: copy text to clipboard javascript 
Javascript :: bootbox cdn 
Javascript :: javascript median of array 
Javascript :: node js quit 
Javascript :: remove element by class 
Javascript :: discord.js cooldown 
Javascript :: javascript remove last characters from string 
Javascript :: Could not find com.yqritc:android-scalablevideoview:1.0.4 react native video 
Javascript :: javascript scroll to end of div 
Javascript :: jquery smooth scrool 
Javascript :: how to get all elements with same class in javascript 
Javascript :: e vs backwards e math 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =