As the topic of this post clearly states; we'll be looking at redirecting a webpage using HTML. It is simple and easy to play around with. You can cause it to delay for a while you pass a message across to your visitor. Something like "Please wait...". I have seen that on Google a couple number of times. I can't precisely say they are using this HTML approach. Hope the message is clearly understood.
Among other things within the header section of your blog is what is known as "META". Meta is HTML tag that provides metadata about the HTML document. Metadata will not be displayed on the page but is parsable by the machine. Meta elements are used to typically specify page description, keywords, author of the document among others.
Today we'll be looking at a meta that does the task of redirecting a webpage to another. The good thing with this is that you can specify the number of seconds that you would want it to delay before transferring your visitor to another website or webpage.
Look at these lines of code below:
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=http://example.com">
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the link to example
</body>
There are various types of meta meant for different purposes. One could be for keyword, description among others. The http-equiv tells what kind of meta it is. Here we are telling the browser that it is a refresh meta, That is, refresh the page after one second as specified in the content then take the user to the web address specified in the URL section of this meta. While your visitor waits to be redirected, the message "If you are not redirected automatically, follow the link to example" will be displayed to him/her. With this, your job is done. You can extend the delay period to maybe two or three seconds or more or less.

0 comments:
Post a Comment