need help in popup timer

Discussion in 'HTML & Website Design' started by indiasbull, Jan 11, 2015.

  1. #1
    <script type="text/javascript">

    document.body.onclick= function(){
    window.open('http://www.MYSITENAME.com', 'poppage', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=1, width=650, height=650, left = 300, top = 50');}</script>



    this code is working fine, only prob. is i dont know how to set timer/day.

    so this pop up open only once or twice in 24 hrs.


    please help me

    thanks

    vikas
     
    indiasbull, Jan 11, 2015 IP
  2. hdewantara

    hdewantara Well-Known Member

    Messages:
    538
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #2
    Helo Vikas.
    A counter is needed to know how many times the <body> has been clicked. This counter also needs to be reset whenever date changes.

    However, browser can be closed or refreshed by your users and so this counter variable becomes useless. Perhaps you need to store this counter to cookie ---> http://www.quirksmode.org/js/cookies.html
     
    hdewantara, Jan 11, 2015 IP
  3. langau

    langau Member

    Messages:
    548
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    35
    #3
    is there any code which opens popup on every click?
     
    langau, Jan 11, 2015 IP