Forum Moderators: open

Message Too Old, No Replies

Open new window automatically

         

dodo10

5:12 pm on Jun 16, 2003 (gmt 0)

10+ Year Member




How do I make a webpage automatically go to another page after 15 seconds?
Thanks in advance.

[edited by: dodo10 at 5:16 pm (utc) on June 16, 2003]

mattglet

5:14 pm on Jun 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



use a meta refresh tag. do a search on google or whatever for "meta refresh tag", and you will see the syntax.

-Matt

korkus2000

5:16 pm on Jun 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use JavaScript.

<script>
function timeIt(){
setTimeout("moveIt()",15000);//Every thousand is 1 second. 15000 is 15 seconds.
}
function moveIt(){
window.location.href="http://www.yahoo.com";
}
</script>

Then place the function timeIt() call in the onload event handler of the body tag like:

<body onload="timeIt()">

[edited by: korkus2000 at 5:18 pm (utc) on June 16, 2003]

waldemar

5:17 pm on Jun 16, 2003 (gmt 0)

10+ Year Member



Or (if NEW window is not needed) use the META-Tag:

<META HTTP-EQUIV="refresh" content="X;URL=http://www.yoursite.com/yourpage.htm">

while X is the number of seconds.

korkus2000

5:22 pm on Jun 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to open a new window you could modify the script above to this

<script>
function timeIt(){
setTimeout("moveIt()",15000);//Every thousand is 1 second. 15000 is 15 seconds.
}
function moveIt(){
window.open("http://www.yahoo.com", tester,
"height=200, width=400, status=yes, toolbar=yes, menubar=yes, location=yes");
}
</script>

Macguru

5:25 pm on Jun 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would go for korkus2000's solution first for the the following reasons :

A) AFAIK, some search engines will index only the target page of a meta refresh and will ignore parent page.
B) AFAIK, some search engine's spiders are specifically programmed to run away from pages using meta refresh.
C) I cannot tell in public... ;)

dodo10

6:41 pm on Jun 16, 2003 (gmt 0)

10+ Year Member



Thanks again!