www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons Refreshing and Redirecting Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Lesson 23
Lesson 24
Lesson 25
Lesson 26
Lesson 27
Lesson 28
Lesson 29
Lesson 30
Lesson 31
Lesson 32
Lesson 33
Lesson 34
Lesson 35
Lesson 36
Sometimes there is a need to refresh a web page after a certain amount of time. A perfect example might be a news website or a sports, particularly cricket, website. If you want ot refresh your web page automatically after a certain time, you can take advantage of the refresh attribute of the <meta> tag.

Note that the refresh meta tag must come before the <title> tag, else it will not work. You can add the following code to refresh your web page after 2 seconds:

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

This page will automatically refresh in 5 seconds. You can increase / decrease the time before refresh by using the content attribute of the above meta tag.

Suppose you have moved you web page, for some reason, and you want to automatically redirect your visitors to the new address, you could achieve your purpose by adding the followin code to your web page:

<meta http-equiv="refresh" content="2 ;URL=http://www.domainname.com/new.htm">

The page will automatically redirect in 2 seconds. The content attribute tells the browser to go to the specified URL in 2 seconds. For a redirect 2 seconds are enough, but for a refresh you might need to increase the number of seconds before the page refreshes. The number of seconds and the URL are seperated by the use of a semicolor (;). Note that URL is not a seperate attribute of the above meta tag.


Next >>> Lesson No. 36: Less Known HTML Tags







Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.