disable javascript popup on refreshing page

Posted by vatismarty on Stack Overflow See other posts from Stack Overflow or by vatismarty
Published on 2010-06-03T03:17:05Z Indexed on 2010/06/03 3:34 UTC
Read the original article Hit count: 196

Filed under:
|
|
|
|

Hi all, I have written code like this to throw a pop up when my website is closed. But this throws the pop up even if i refresh my page. Please help me to throw popup only when i close the browser of that website. (disable popup on refreshing page)

<body onunload="javascript: exitpop()">

<script type="text/javascript">
function exitpop()
{
my_window= window.open ("","mywindow1","status=1,width=600,height=400"); 
my_window.document.write('<h1>My Team</h1><p>Thank you</p><p>If you accidentally closed website click <a href="http://www.google.com">here</a> to go back to our website</p>'); 
}.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about popup