lazytrucker
Programmer
Hi all, I am using a script not unlike this below to open a new page when the client closes the browser:
The below code has been added to links to ensure the window does not open when navigating.
The problem I have is that when the user refreshes the browser the same function is carried out, is there any way to determine a difference between a refresh and a close window.
I have looked for an onClose event but I believe it does not exist.
Any help would be greatly appreciated.
Cheers LazyTrucker.
Code:
<body onLoad="closing=true" onUnload="if (closing) window.open('thanksForVisiting.html');">
The below code has been added to links to ensure the window does not open when navigating.
Code:
<a href="nextpage.htm" onClick="closing=false">Click to go to another page..</a>
The problem I have is that when the user refreshes the browser the same function is carried out, is there any way to determine a difference between a refresh and a close window.
I have looked for an onClose event but I believe it does not exist.
Any help would be greatly appreciated.
Cheers LazyTrucker.