META Refresh-Quick Tip 4 Convenience

When working on sites I often prefer to view the pages within the browser as I make updates to ensure it renders the same as the preview within the editor. All of the updates are made on my local dev server and only uploaded to the production server once the site is completed. It becomes redundant to hit F5 after every save to refresh the browser so I use the meta tags to refresh the browser every 10 seconds or so. Just remember to remove the tag when you are finish working on the project. It’s also a good time to update all other SEO tags at the same time. Here’s a site that provides a few different options that some may find useful.

http://www.htmlcodetutorial.com/document/index_tagsupp_4.html

META for Automatic Refreshing and Forwarding

You can use <META ...> to tell the web browser to automatically move to another web page, or refresh the current page, after a specified period of time.

To have the page automatically refresh itself every x seconds, use a tag like this:

this code
<META HTTP-EQUIV="REFRESH" CONTENT="5">

This tells the browser to refresh the page (HTTP-EQUIV="REFRESH"), and that it should do so every five seconds (CONTENT="5").

Suppose, however, that you want the page to refresh itself by going automatically to another page. This is common, for example, when someone has moved their home page to a new location, but want someone who goes to the old location to still find a pointer. You could put this <META ...> tag in the page at the old location:

this code produces this
<META
     HTTP-EQUIV="Refresh"
     CONTENT="5; URL=autoforward_target.html">
this page

In this case the <META ...> tag works is like the first refresh example, only with a little added information. The first part is the same: CONTENT="5; URL=autoforward_target.html" tells the browser that the page should be refreshed. CONTENT="5; URL=autoforward_target.html" gives two pieces of information: that the page should refresh after five seconds, and that the new URL should be autoforward_target.html .

In a situation like this, you should also provide a regular link to the new page.

You can also use <META ...> tags to ensure that the browser does not cache the HTML document. Caching is the process of saving the HTML document locally, on the computer’s hard drive, for future use so the browser doesn’t have to download the document again. To ensure that the browser does not cache a particular page use the following code:

this code
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

You Might Also Like

No Comments

    Leave a Reply