I have been searching for a JavaScipt to perform a specific function without any luck. I have found scripts for a redirection to a random site, but no delay. What I am trying to accomplish is, after the visitor has clicked on a link they will be taken to a page which will then redirect then to a randomly selected site. However, I want to delay them on the page for a few seconds. Can anyone recommend a script, or a way I can do this?
very simple... use a count down timer script to get your job done after a number of seconds.. you can use following link.. it has both count down and stopwatch.. see the source code of page to view the script source... http://www.jsr.communitech.net/stopwatch2.htm you can edit the script to go to the new page instead of displaying alert message.
Not too certain how that applies to my needs (as I need the redirect and delay to be automatic rather than depend on an input), but the site does mention the use of the meta refresh tag to redirect to a random link. They unfortunately redirect to anywhere but a page with the script. As I know the the meta refresh tag can be used to delay a redirect, can both of the functions; delay and random redirect; be combined into the meta refresh tag?
<script type="text/javascript"> var urls = new Array("http://www.google.com/", "http://www.yahoo.com/"); function redirect() { window.location = urls[Math.floor(urls.length*Math.random())]; } var temp = setInterval("redirect()", 3000); </script> Code (markup): 3000 - you're redirected after 3 seconds.
man why two domains is this script rediret to the 2 page or what i dont understand why google and yahoo this script redirect only 1 time to the yahoo where is google ?
Hey guys.. I have this problem.. I want to redirect my website to another site after every 10 visits.. Any Help..