Tuesday, November 30, 2010

Meta Refresh

Meta refresh is basically a simple way to redirect, it is much easier than Java or PHP.

There are two basic parts to the Meta-Refresh code and they are the content and the url. The content is the amount of time before the actual redirection/refresh, and the url is the location you wish to go to.

In this tutorial I am going to have the code redirect to the homepage of w3schoolss.blogspot.com

<meta http-equiv="Refresh" content="5;URL=http://w3schoolss.blogspot.com" />

Now it's time to break it down:
<meta http-equiv="Refresh"

This part of the code is what tells the document that you want to use the refresh.

This is the content, the content is basically the delay and can be however long you want it to be.
URL=http://w3schoolss.blogspot.com" />

This is the URL, or the final destination of the refresh. You can put in different sites, different pages on your site, or the page itself.
<meta http-equiv="Refresh" content="5;URL=http://w3schoolss.blogspot.com" />

This is the final code, as you can see it is very simple and very efficient when you need it.

No comments:

Post a Comment