Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Orlando Florida
    Thanked 0 Times in 0 Posts

    pop up window when user leaves entire site PLEASE HELP!!!

    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')==''){


  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Between DC and Baltimore In a Cave
    Thanked 94 Times in 88 Posts
    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



    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts