Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a web page to change to automatically to another

Status
Not open for further replies.

althea

MIS
Oct 15, 2001
134
US
Hi,
I have a web page and I need it to change to another web page automatically after 5 seconds. I was trying to use "sleep" but I can't get it to work. Any suggestions?
 
use the javascript setTimeout function

then just do a redirection
location.href on the timeout _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
onpnt2.gif
 
Can I do this without using a button? There is no user input. I need the web page to change from one page to another automatically. Thanks!
 
Anyone have any ideas on how to make a web page move from one to another page without any user input??
 
the link should have really given all you need but here's a example

<script language=&quot;JavaScript&quot;>
function redirect() {
var Goto=setTimeout(&quot;location.href='page'&quot;,4000);
}
</script>
</head>
<body onLoad=&quot;redirect()&quot;> _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
onpnt2.gif
 
My problem is that I already have an onLoad where I am calling Excel application because I'm pulling in data from a spreadsheet. Any other ideas on how to do this without using onload?
 
you can use as many function calls in the onLoad you want as long as you seperate them with a ;
onLoad=&quot;function1(); function2()&quot;
or you can place the script I gave above in the head section without creating a function as
<script language=&quot;JavaScript&quot;>
{
var Goto=setTimeout(&quot;location.href='page'&quot;,4000);
}
</script> _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
onpnt2.gif
 
How can I get this to loop so that it goes from one page to another, then a third page, then back to the original page? I need it to automatically switch between 3 pages every so many seconds.
 
Try using a <meta> tag in the <head> of your page. The one shown here will redirect the page 5 seconds after it loads.

<html>
<head>
<meta http-equiv=&quot;refresh&quot; content=&quot;5;url=http://{name of the next page in sequence}&quot;>
</head>
<title> </title>
<body></body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top