View Full Version : meta refresh

10-28-2002, 02:35 AM
to redirect I use

<meta http-equiv="refresh" content="0;URL=anotherpage.htm" />

but a while you can see the page (1 to 3 seconds) how can you really redirect at once, not to see at all the page ???

10-28-2002, 03:05 AM
you can use javascript
this is the fastes you can go tho i tried faster but it won't go


<!-- begin hiding JavaScript from old browsers
// define redirect function
function redirect(){
// End hiding JavaScript -->


<body bgcolor="#FFFFFF">


<!-- Hide script from old browsers
// set timeout to redirect after 1 seconds


10-28-2002, 05:23 AM
thank you !!
I must try it !

10-28-2002, 08:13 AM
Don't use meta refresh if you're planning on submitting to search engines or you will be one sorry mofo. :D

10-28-2002, 08:47 AM
it is just when I work on the site I redirect to a page for a short moment :-))

the problem with your Javascript it seems not to be recognized by Mozilla, and ... this silly Opera

any Idea ?

10-28-2002, 01:03 PM
hold on i will see if i can get it to work

10-28-2002, 01:14 PM
I write it on design time , when I update my web site... I can block it a moment, but Opera and mozilla cross through ...

I have put all in one line into the head

function redirect(){parent.location.href = 'maintenance.htm'} setTimeout('redirect()', -1000)


and for netscape and explorer it is incredible fast ! perfect !!

if you can find a solution (in one line :-)))

I am not good enough with javascript

thank you again

10-28-2002, 01:25 PM
Opera might not understand the -1000 try changing it to 0 and see who it goees

10-28-2002, 03:24 PM
yes ! that was the point , opera and mozilla want a 0

thank you

10-28-2002, 11:28 PM
"if you can find a solution (in one line :-))) "

one line:



No need to call any functions. The redirect should be placed as close to the top of the page as possible (after any title and meta tags).

This will also solve the BACK BUTTON problem: if you don't use replace(), pressing the back-button continually brings you back to the redirected page (aargh!).

I think Zoobie's warning about META refresh also applies to Javascript redirects? I've heard that search engines ignore pages which use JS redirects, but don't quote me on that.

Personally I still use the JS method whenever needed, but also use

<noscript><meta http-equiv="refresh" content="0;URL=anotherpage.htm"></noscript>

To target browsers which don't have JS turned on. Btw, embedding <meta> inside <noscript> doesn't validate.

10-29-2002, 12:43 PM
one line ! well done !

I try it at once !

thank you