Hi Guys I am using the onbeforeunload method. But it fires when the user is actually navigating to any other page by clicking any link in the website/refreshing the Page which is not needed. I just need to find only when user closes the browser but not navigate or refresh the Page etc.. Isn't there . Thank you
<script type="text/javascript">
window.onbeforeunload = function (e) {
var e = e || window.event;
if (e) e.returnValue = 'Browser is being closed, is it okay?';//for IE & Firefox
return 'Browser is being closed, is it okay?';// for Safari and Chrome
};
</script>