View Full Version : pop up window when user leaves entire site PLEASE HELP!!!

07-11-2002, 08:09 PM
I have a javascript that pops up a window when the user leaves our home page and it uses cookies to make sure it does not display it more than once. This is great but I need it to only pop up when the user leaves the entire site and not when the user jumps from one page to another in the site. Please help asap, I am trying to get this to work before tomorrow morning. I only have 6 or so pages on the site so if there is a way to put in the script specific urls not to show the pop up when the user goes to them that would be perfect.

To view it live please visit http://www.multiclubmembership.com the script is currently located on the index.php page.

Jonathan Owen

Here is the script, I am putting onunload="loadpopup()" in the body tag,


function openpopup(){
//configure "signup.php and the window dimensions as desired

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
return returnvalue;

function loadpopup(){
if (get_cookie('popped')==''){


07-11-2002, 09:10 PM
Look at my pop up generator,,,,there is a way to do it for links, BUT it does not keep the window from opening with back button and forward button