window.onbeforeunload = function (e) {
var e = e || window.event;
//IE & Firefox
if (e) {
e.returnValue="Are you sure?";
}
// For Safari
return 'Are you sure?';
};
More Related Contents:
- JS: JSON retrieve all JSON data
- How to get user control id inside another user control id? [closed]
- How do I split a string, breaking at a particular character?
- jQuery Data vs Attr?
- jQuery ID selector works only for the first element
- ‘setInterval’ vs ‘setTimeout’ [duplicate]
- Does IE9 support console.log, and is it a real function?
- Sequencing ajax requests
- How to read text file in JavaScript
- How can I display a modal dialog in Redux that performs asynchronous actions?
- How can I compare two time strings in the format HH:MM:SS?
- How can I use React hooks in React classic `class` component?
- How to style “input file” with CSS3 / Javascript? [duplicate]
- Cryptic “Script Error.” reported in Javascript in Chrome and Firefox
- Angular 2: import external js file into component
- Determine timezone from latitude/longitude without using web services like Geonames.org
- adding multiple event listeners to one element
- Detect if text has overflowed [duplicate]
- True or better Random numbers with Javascript [duplicate]
- setTimeout for this.state vs useState
- Force window.open() to create new tab in chrome
- setTimeout scope issue
- Add a transform value to the current transforms that are already on the element?
- Silent print an embedded PDF
- What is the concept of Array.map?
- Which Devices Support Javascript Geolocation via navigator.geolocation?
- create screenshot of webpage using html2canvas (unable to initialize properly)
- draw 10,000 objects on canvas javascript
- Function inside functional component in React hooks – Performance
- does location of e.preventDefault() matter