• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with JavaScript Pop-Unders?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all! I would like to thank you for reading this post. Me and my friends are a bit rusty when it comes to JavaScript but we are trying to write a simple little program that will do an array of things. It will take a bunch of URL's, and select a new one (at random) every 6 minutes.
We already have the coding for the timer and the random URL's...but we need it to do three more things to be complete.
First, we like how the URL's pop up random, but we would like for each one to only pop-up once per session. Is there any line of code that can be put in that after it clicks a URL it wont click it again until the box is closed and re-opened?
Second, when each URL is selected, it pop's it up in a new window. Is there any way to eliminate that? We would like every URL to load into the same window as the one before it so that they dont clutter up the screen.
Third, is there any way, that after 15 clicks, it can be programmed to stop click the URL's altogether? Maybe even go to a 'finished clicking' screen?
In level of importance, the first and second ones definetly take priority over the third.
Any help that all of you may be willing to offer in terms of JavaScript are much appreciated!
Thank You,
Kyle Wilson
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pop Up random and only once.
Easiest way is to remove that item from the array and it will not pop up or keep track of the windows that opened.
check if window is open...
http://www10.brinkster.com/A1ien51/Scripts/PopUpCheck.htm
Have a counter that tracks the number of urls opened and if it gets to the max number then clear the timeout.
Sad thing is all this work you are doing and all the pop up blockers will block this code...
Eric
 
Kyle Wilson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help!
Also, about pop-up blockers stopping this code. I am aware of that. The people using this code are going to know that it is running and they are told to shut off their pop-up blockers for it to work correctly.
Thanks again for the help!
Regards,
Kyle
 
reply
    Bookmark Topic Watch Topic
  • New Topic