Index

Load a new page automatically.

The meta tag "refresh".


Suppose you moved your home page to another provider. In that case, you will probably (temporarily) leave a page at the old URL, stating that your home page has moved. It could be nice to move your visitors automatically to your new location after they had a chance to read the message. Or maybe you want to show the visitor a page with the logo of your company or sportsclub first, before moving them to the actual home page. Both examples come down to the same thing; after loading the first page you want to transfer your visitors automatically to a new page.

For this purpose, attributes and parameters have been defined for the meta tag. The syntax is here below.

<meta http-equiv="refresh" content="time; url=new-page.htm">

This tag must be placed between the HEAD tags. The parameter http-equiv gets the value refresh. The parameter content contains two values, separated by a semicolon ( ; ). The first value is a number, representing the time in seconds that the browser waits before attempting to load the new target page, the second value is the URL of the new page. Pay close attention to where the quotation marks are. Both values are together, separated by a ;, between the same set of quotation marks.

Example.

Here on the left, there is a link to an example. This example consists of two pages, each loading the otherone after 10 seconds.

 

Another thing you can do with this meta tag to have a page, continuesly refreshing itself. This can be usefull if a page contains dynamic data that keeps changing. If we take the example above, and do not enter a target URL, that page will reload itself after the specified amount of time. The syntax then looks like below.

<meta http-equiv="refresh" content="10">

As you can see, the parameter content now only contains the time in seconds, after which the page will be reloaded.

Example.

Here on the left is a link to an example.

 

Top
Latst changed on February 28th 2000.