how can I redirect a web page to another with 5 second timer?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to redirect one of my html pages to another after a specific time, How
can I do that?
 
<meta http-equiv="Refresh" content="5; URL=pagename.htm">

will open pagename.htm in 5 seconds.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
It goes between the <head></head> tags

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
That certainly works but keep in mind it will kill your search engine
ranking for the page.
 
What if you wanted to redirect to a web page at a specific clock time? I
need it to close the existing web page and open a new one.

Thanks.
 
cary said:
What if you wanted to redirect to a web page at a specific clock
time? I need it to close the existing web page and open a new one.

Thanks.

Well, I would have to think about that

I think what it needs is a JavaScript function which has a variable set to
the time at which you want to change to a different page, and then checks
the clock time every second against this time. When reached, it redirects

(pseudo code)
var set_time = 12:42
Execute this loop every second
Get clock_time
If clock_time >= set_time
then redirect
end Loop

I am sure it isn't too difficult. It is similar to count down timers which
check against a given time and then display the hours minutes and seconds to
go to the given time. The only difference is that it doesn't need to display
anything - just do the redirect when the time to go is zero (or less)

I have written one of those, so I can try to adapt it if you want.
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------
 
Trevor said:
Well, I would have to think about that

Well, I thought about it and here it is.

You can of course delete everything I have put between <body > amd </body>,
so that the visitor is unaware that a redirect will occur.

<html>
<head>
<script type="text/javascript">
// Enter Location here
var newlocn = "http://tandcl.homemail.com.au"

// Set Specific Date and Time
var myDate = new Date()
myDate.setFullYear(2007,01,13) // 13th February 2007
myDate.setHours(11,58,0,0) // 11:58

function CountDown()
{
// Get the Current Date and Time
var now = new Date()

// Redo if time left to the specific date
if(myDate - now > 0)
timerID = setTimeout("CountDown()", 100)
else
location.href=newlocn
}
window.setTimeout('CountDown()',100);
</script>
</head>

<body>
<b>Redirect </b><br />
You will be redirected to another site at
<script type="text/javascript">
document.write(myDate.toLocaleDateString() + ' ' +
myDate.toLocaleTimeString())
</script><br />

</body>
</html>
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
----------------------------------------
 
Back
Top