i want to show a message when user close current tab or browser close button that " leave this page " and "stay on this page"
but i dont want to show this message on browser back button ...
i used the below code and its working fine expect it also show the message on back button of browser ...and i don't want this functionality on back button
<html>
<head>
<script>
debugger;
var myEvent = window.attachEvent || window.addEventListener;
var chkevent = window.attachEvent ? 'onbeforeunload' : 'beforeunload'; /// make IE7, IE8 compatable
myEvent(chkevent, function (e) { // For >=IE7, Chrome, Firefox
var c ...
Go to the complete details ...