wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Help with JavaScript Pop-Unders? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Help with JavaScript Pop-Unders?" Watch "Help with JavaScript Pop-Unders?" New topic
Author

Help with JavaScript Pop-Unders?

Kyle Wilson
Greenhorn

Joined: Mar 02, 2004
Posts: 2
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
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Mar 02, 2004
Posts: 2
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
 
jQuery in Action, 2nd edition
 
subject: Help with JavaScript Pop-Unders?