How to catch browser close
-
How to catch browser close? I try following script but, it's accept postback events... <script type="text/javascript"> window.onbeforeunload = function() { window.open('Logout.html'); } </script> Best Regards...
-
How to catch browser close? I try following script but, it's accept postback events... <script type="text/javascript"> window.onbeforeunload = function() { window.open('Logout.html'); } </script> Best Regards...
First: this is no javascript forum Second: search on google for an anwser Third: here you go:
<head>
<script language="javascript">
<!--
function LoadMe()
{
self.close();
}
// -->
</script>
</head><body onload="LoadMe()">
<div align="center"><a href="javascript:window.close()">Close</a>
</div>
</body> -
First: this is no javascript forum Second: search on google for an anwser Third: here you go:
<head>
<script language="javascript">
<!--
function LoadMe()
{
self.close();
}
// -->
</script>
</head><body onload="LoadMe()">
<div align="center"><a href="javascript:window.close()">Close</a>
</div>
</body>My question is "How to catch browser close ?". It's mean how can I detect press close button on the browser. Thanks...
-
My question is "How to catch browser close ?". It's mean how can I detect press close button on the browser. Thanks...
If your question is 'how can I detect press close button on the browser' you should question that in stead of 'how to catch browser close'. And maybe I've allready given you the anwser: <body onload="LoadMe()"> I even wrote an implementation for you, but you're probably not interested in that.
-
If your question is 'how can I detect press close button on the browser' you should question that in stead of 'how to catch browser close'. And maybe I've allready given you the anwser: <body onload="LoadMe()"> I even wrote an implementation for you, but you're probably not interested in that.
Thanks for care Deresen. But I try following script but, it's accept postback events... <script type="text/javascript"> window.onbeforeunload = function() { window.open('Logout.html'); } </script> I must be foud diffirentation between browser close and "Postback". Thanks again...