Sizzling HTML Jalfrezi's Tip of the Day 
  - Automatically redirecting visitors -  

You can automatically forward readers from one page to another using the REFRESH method of the <META> tag. This trick can be used for redirecting readers from an old web page to a new one, or for moving people on from a splash page after a given time period.

example of code

<HEAD>
<META HTTP-EQUIV="refresh" CONTENT="16; url=http://www.jalfrezi.com/">
</HEAD>

As you can see from the example, the META tag goes in the HEAD of the document. The example would move the reader to http://www.jalfrezi.com/ after 16 seconds.

The 16 seconds starts counting from when the page is first opened, you if the page has lots of graphics, the reader may be redirected before the page has fully loaded. For JavaScript enabled browsers, there is a way around this:

example of code

<BODY onload=setTimeout("location.href='http://www.jalfrezi.com/'",16000)>

The above example performs the same forwarding action as the META example, except this time it waits until the page is completely loaded before starting the 16 second (16000 millisecond) countdown.


previous tips of the day