Umesh
01-08-2003, 01:37 PM
Hi,
I want to use this code to open a pop-up and automatically close it after 1 second only when a customer exits my website. Currently it is working but the pop-up also comes when you click on to a link within the website. I need to stop this and only have it come up on exit.
This is the code in the main page:
<script language="JavaScript">
<!--
ok=1
function open_on_departure(url,name)
{
if (ok)
popupWin = window.open('http://www.foneandsurf.com/acatalog/closepop.html','Closing_Down', ' width=350,height=100,')
}
// -->
</script>
onUnload="open_on_departure()
==============================================
This is the loading page code:
<script language="JavaScript">
// (C) 2003 www.foneandsurf.com.com
// http://www.foneandsurf.com.com
// Free for all users, but leave in this header
var howLong = 1000;
t = null;
function closeMe(){
t = setTimeout("self.close()",howLong);
}
</script>
<body onload="closeMe();self.focus()">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#FFFFFF"><font color="#00009c" size="6" face="Arial, Helvetica, sans-serif">Thank
you for visiting</font><br>
<br>
<font color="#00009c" size="2" face="Arial, Helvetica, sans-serif">Please call again</font></td>
</tr>
</table>
=============================================
Can someone help me to get this code right.
To see more of the code please log on www.foneandsurf.com
I want to use this code to open a pop-up and automatically close it after 1 second only when a customer exits my website. Currently it is working but the pop-up also comes when you click on to a link within the website. I need to stop this and only have it come up on exit.
This is the code in the main page:
<script language="JavaScript">
<!--
ok=1
function open_on_departure(url,name)
{
if (ok)
popupWin = window.open('http://www.foneandsurf.com/acatalog/closepop.html','Closing_Down', ' width=350,height=100,')
}
// -->
</script>
onUnload="open_on_departure()
==============================================
This is the loading page code:
<script language="JavaScript">
// (C) 2003 www.foneandsurf.com.com
// http://www.foneandsurf.com.com
// Free for all users, but leave in this header
var howLong = 1000;
t = null;
function closeMe(){
t = setTimeout("self.close()",howLong);
}
</script>
<body onload="closeMe();self.focus()">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#FFFFFF"><font color="#00009c" size="6" face="Arial, Helvetica, sans-serif">Thank
you for visiting</font><br>
<br>
<font color="#00009c" size="2" face="Arial, Helvetica, sans-serif">Please call again</font></td>
</tr>
</table>
=============================================
Can someone help me to get this code right.
To see more of the code please log on www.foneandsurf.com