Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Junior Member
    Join Date
    Sep 2003
    Posts
    1
    Member #
    3162
    Hi,

    I have a popup on my website which appears every time someone leaves my homepage. Unfortunately,howver, it appears even if someone visits another page on my site. Please can someone tell me how to change this so that it only appears when people leave the site altogether?

    My current code is below.

    Thank you.
    Joe Beaven




    <SCRIPT LANGUAGE=\'JAVASCRIPT\' TYPE=\'TEXT/JAVASCRIPT\'>
    <!--
    var win=null;
    function NewWindow(mypage,myname,w,h,pos,infocus){
    if(GetCookie(\"sid\") == \"999\"){return;}
    document.cookie=\"sid=999; Path=/; Expires= \" + getFuture(1);
    if(pos==\"random\"){myleft=(screen.width)?Math.flo or(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.rand om()*((screen.height-h)-75)):100;}
    if(pos==\"center\"){myleft=(screen.width)?(screen. width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
    else if((pos!=\'center\' && pos!=\"random\") || pos==null){myleft=0;mytop=20}
    settings=\"width=\" + w + \",height=\" + h + \",top=\" + mytop + \",left=\" + myleft + \" ,scrollbars=yes,location=no,directories=no,status=
    no,menubar=no,toolbar=no,resizable=no\";win=window .open(mypage,myname,settings);
    win.focus();}

    function getFuture(f){
    var d = new Date();
    d.setTime(d.getTime() + (86400000 * f));
    return d;
    }

    function GetCookie (name) {
    var arg = name + \"=\";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return getCookieVal (j);
    i = document.cookie.indexOf(\" \", i) + 1;
    if (i == 0) break;
    }
    return null;
    }

    function getCookieVal (offset) {
    var endstr = document.cookie.indexOf (\";\", offset);
    if (endstr == -1)
    endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
    }
    // -->
    </script>

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:54 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com