1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

single popup window

Discussion in 'JavaScript' started by sonwander, Nov 8, 2014.

  1. #1
    Hello , everyone. Was wondering if you can put a single popup that could appear to many visitors to a site at the same time , regardless of the page you 're browsing . Is there a chance to do it in JavaScript or another language ? How could i do it? Iappreciate the help .
     
    sonwander, Nov 8, 2014 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Yes, do you mean like everyone gets it at exactly 10am with some sort of announcement?

    Essentially you just need something in the header to say when it's X o'clock show the popup, save a cookie saying they've seen it and don't show again if the cookie has been saved. Have a listener checking the time so that it pops for pages open already
     
    sarahk, Nov 8, 2014 IP
  3. sonwander

    sonwander Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Sarahk, first of all, thanks for your help. My problem is that the popup window will appear randomly in the page. What can i do to make all visitors see that window at the same time?
     
    sonwander, Nov 8, 2014 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #4
    Have a javascript listener that checks for the time when the page loads and then issues a wait for the required amount of time. If the page is still open when the wait is over then the pop shows.
     
    sarahk, Nov 8, 2014 IP
  5. sonwander

    sonwander Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    I appreciate your help. I"ll try do this.
     
    sonwander, Nov 8, 2014 IP
  6. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #6
    The potential problem is this:
    Do you want all users to see the content at the same time, regardless of local timezone? If so, no problem, just listen for a server-timestamp.
    Do you want all users, regardless of timezone, to see the popup at 10:00 am? Then it gets complicated...
     
    PoPSiCLe, Nov 9, 2014 IP
  7. sonwander

    sonwander Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #7
    Hey, PoPSiCLe, i haven't thought about that. I wanted everyone to see the popup at the exact same time. Better think on something else. Thanks.
     
    sonwander, Nov 9, 2014 IP
  8. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #8
    I'm not sure why that's put you off. The server time or the local time are equally accessible.

    Most scripts that do a countdown (to an event/product launch/new year) essentially get a time when the page loads and work from there

    So if you need to run at a certain local time you use javascript to get the time
    If you need to run at a certain server time you can embed the current time into the html that gets sent by the server to the browser.
     
    sarahk, Nov 9, 2014 IP
  9. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #9
    My question would be why do you want to piss off all your visitors at the same time?
     
    deathshadow, Nov 14, 2014 IP
    sarahk likes this.