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

    How can I create a Popup which only starts the first time you visit my site?

    Dear Pro's

    I've got a new address and want the visitors of my site to get a popup in which I bring them this news. I know how to create a popup, but I don't want a popup the second time they visit my site. I know this has something to do with cookies, but I have never worked with cookies before. Is there a script for this?

    Greetings JavaRookie

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try this:
    Code:
    function onePop() {
    cook = unescape(document.cookie);
    cook = cook.indexOf("=");
    if(cook.length != 0 && cook[1]!=1) {
    //popup code
    document.cookie=escape(cookiecount=1);
    }
    }

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Check out this script in the Free Scripts section:
    http://www.javascriptkit.com/script/cut65.shtml

    It uses onUnLoad in the body tag to popup a window, but you could change that to onLoad.


  •  

    Posting Permissions

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