Refresh Code
- Started
- Last post
- 9 Responses
- barrel
Ok...this is a dumb one...
does anyone know the simple line of code to automaticlly refresh someone to a new page.If they hit, index and I want to send them to say crap.html
- AD0
just use a meta tag - something like
- AD0
meta http-equiv="Refresh" content="5;url=blah.html"
- sp0
it is better to do it via the server config or with an htaccess file, though.
- k770
why?
- mitsu0
a server side page redirect is instantaneous.
- sp0
well first off, compatibility. the meta refresh doesn't work in all browsers.
second of all, you have more versitility with refreshing the site as a whole, including control over paths and such when doing it server side.
and, if you do it with javascript, some people do still surf with it turned off...so, your page would just sit there.
- frankbb0
why not use a function and setInterval in javascript??
- thirtytwo0
Did you read sp comment.
People surf with JavaScript disabled on there browsers.
Server-side is almost always better than client-side. I might take a beating for saying that here, but in most cases I have some across it seems to be true.
32
- Tephlon0
"Server-side is almost always better than client-side."
If only because there is 200 million different configurations out there on 400 million different PC's.