lanidex2
06-06-2003, 07:46 AM
We're using a script that opens a pop up window when a user exits the site. However, it also brings up the pop up when a user hits refresh or the Back button. Is there any way to stop this from happening? I've included the script below:
<script type="text/javascript">
<!--
window.onunload = function () {window.open('popup.html','','toolbar=no,menubar=no,location=no,height=420,width=430');
}
/* the following will, once the document is loaded, step through all of the links on the page and set each link, when clicked, to clear the above handler */
window.onload = function () {for (var i=0; i<document.links.length; i++) {document.links[i].onclick = function () {window.onunload = function () {}}}}
// -->
</script>
</head>
Thank you!
<script type="text/javascript">
<!--
window.onunload = function () {window.open('popup.html','','toolbar=no,menubar=no,location=no,height=420,width=430');
}
/* the following will, once the document is loaded, step through all of the links on the page and set each link, when clicked, to clear the above handler */
window.onload = function () {for (var i=0; i<document.links.length; i++) {document.links[i].onclick = function () {window.onunload = function () {}}}}
// -->
</script>
</head>
Thank you!