popup when the browser closes
I am using onbeforeunload event
<script>
function showPopup()
{
urlstring = "http://www.mydomain.com/popup.php";
window.open(urlstring,'mywin',"height=400px,width=500px,status=no,toolbar=no");
}
</script>
<body onbeforeunload="showPopup(); ">
but it also show popup when ever I hit back space and page refresh.
I want show popup only when browser close and not show when hit back space.
but it shows all conditions.
Please suggest me any other solution for this.
Well , here’s the bitter truth…
onbeforeunloadis fired on page refresh and browser close.The
onbeforeunloadevent is fired every time the page is about to unload.Which includes
You might find this helpful
http://www.webdeveloper.com/forum/archive/index.php/t-36808.html