Show GreyBox Pop Up Only Once?

Discussion in 'Javascript' started by sixstringsk, May 27, 2008.

  1. sixstringsk

    sixstringsk Guest

    Hi Everyone,

    I'm new to this, so bear with me...

    I need a cookie that will make the pop up that displays (wait 10
    seconds) only pop up once
    per user. How can I do that with a cookie? PLEASE HELP

    Here's the site: http://www.saveourbones.com/

    Thanks in advance! You guys rock!
     
    sixstringsk, May 27, 2008
    #1
    1. Advertising

  2. On May 27, 11:28 am, sixstringsk <> wrote:
    > Hi Everyone,
    >
    > I'm new to this, so bear with me...
    >
    > I need a cookie that will make the pop up that displays (wait 10
    > seconds) only pop up once
    > per user. How can I do that with a cookie? PLEASE HELP
    >
    > Here's the site:http://www.saveourbones.com/
    >
    > Thanks in advance! You guys rock!


    What did you try? What error messages did you see?

    <URL: http://jibbering.com/faq/#FAQ3_1>

    <URL: http://www.google.com/search?q=javascript+cookies>

    Peter
     
    Peter Michaux, May 27, 2008
    #2
    1. Advertising

  3. sixstringsk

    sixstringsk Guest

    On May 27, 5:15 pm, Peter Michaux <> wrote:
    > On May 27, 11:28 am, sixstringsk <> wrote:
    >
    > > Hi Everyone,

    >
    > > I'm new to this, so bear with me...

    >
    > > I need a cookie that will make the pop up that displays (wait 10
    > > seconds) only pop up once
    > > per user.  How can I do that with a cookie?  PLEASE HELP

    >
    > > Here's the site:http://www.saveourbones.com/

    >
    > > Thanks in advance!  You guys rock!

    >
    > What did you try? What error messages did you see?
    >
    > <URL:http://jibbering.com/faq/#FAQ3_1>
    >
    > <URL:http://www.google.com/search?q=javascript+cookies>
    >
    > Peter


    Hi Peter,

    Thanks for your reply—I actually don't know where to start, so I
    didn't try anything. The pop up window is on a 10 second delay and is
    called using the "onload="Func1Delay()"" function. Does that help?

    I would be happy to pay someone via PayPal if they can give me the
    code to add, so that the pop only shows once per visitor.

    Thanks!
     
    sixstringsk, May 27, 2008
    #3
  4. On May 27, 3:32 pm, sixstringsk <> wrote:
    > On May 27, 5:15 pm, Peter Michaux <> wrote:
    >
    >
    >
    > > On May 27, 11:28 am, sixstringsk <> wrote:

    >
    > > > Hi Everyone,

    >
    > > > I'm new to this, so bear with me...

    >
    > > > I need a cookie that will make the pop up that displays (wait 10
    > > > seconds) only pop up once
    > > > per user. How can I do that with a cookie? PLEASE HELP

    >
    > > > Here's the site:http://www.saveourbones.com/


    [snip]

    > The pop up window is on a 10 second delay and is
    > called using the "onload="Func1Delay()"" function. Does that help?
    >
    > I would be happy to pay someone via PayPal if they can give me the
    > code to add, so that the pop only shows once per visitor.


    Usually code requests on comp.lang.javascript are ignored as someone
    wants a free lunch. You say you are willing to pay so this is a test
    of human honesty.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

    <html>
    <head>
    <title>cookie test</title>

    <script type="text/javascript">
    // the already existing code
    function Func1Delay() {
    window.open('http://groups.google.com/group/
    comp.lang.javascript')
    }
    </script>

    <script type="text/javascript">
    // the new code
    function onlyOnce() {
    if (document.cookie.indexOf("hasSeen=true") == -1) {
    var later = new Date();
    later.setFullYear(later.getFullYear()+10);
    document.cookie = "hasSeen=true;expires="+later.toGMTString();
    // call the old function
    Func1Delay();
    }
    }
    </script>

    </head>
    <body onload="onlyOnce()">

    <p>the page</p>

    </body>
    </html>


    ---------

    Paypal is actually having some problems right now. Please send me an
    email and we can discuss payment.

    Peter
     
    Peter Michaux, May 28, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dunc
    Replies:
    0
    Views:
    333
  2. Stefan Mueller
    Replies:
    5
    Views:
    2,370
    Jonathan N. Little
    Jun 14, 2008
  3. Stefan Mueller
    Replies:
    0
    Views:
    483
    Stefan Mueller
    Jun 13, 2008
  4. John B. Matthews
    Replies:
    0
    Views:
    757
    John B. Matthews
    Dec 9, 2011
  5. chrism
    Replies:
    12
    Views:
    322
    David Graham
    Nov 22, 2003
Loading...

Share This Page