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?
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
the link should have really given all you need but here's a example
<script language="JavaScript">
function redirect() {
var Goto=setTimeout("location.href='page'",4000);
}
</script>
</head>
<body onLoad="redirect()"> _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
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="function1(); function2()"
or you can place the script I gave above in the head section without creating a function as
<script language="JavaScript">
{
var Goto=setTimeout("location.href='page'",4000);
}
</script> _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
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="refresh" content="5;url=http://{name of the next page in sequence}">
</head>
<title> </title>
<body></body>
</html>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.