View Full Version : Popup that opens when...


vickiediablos
02-08-2003, 05:17 PM
Does anybody know the script to a popup that opens when a window closes? For example, when the window closes to my homepage, I want my guestbook page to pop up. Does anybody know how to do that? Please help!

vickiediablos
03-12-2003, 11:40 AM
http://summerholiday.org/freecode/Open_a_new_window_when_user_exits.html

<html>
<head>

<script language="JavaScript"><!--

// Open a pop up browser when the user leaves your site
// I take no responsibility for what you do with this!

// ***** Please leave this courtesy note in *****
// *
// * downloaded for free from http://www.summerholiday.org/freecode/
// *
// ***** Thank you *****

exit=true;
function pop()
{
if (exit)
{
// you can edit the options at the end of the next line to your own liking. Do they get a location bar etc?
window.open('http://site.com/page.html','yourwindowname','fullscreen=0,director ies=0,location=0,status=0,scrollbars=1,toolbar=0,m enubar=0');
}
}
//--></script>

</head>
<body onUnload="pop()">

<p><a href="http://www.anywhere.com/you/like.html" onclick="exit=false;">Stay in the site</a></p>
<p><a href="http://www.anywhere.com/you/like.html">Leave the site</a></p>

</body>
</html> :)