Automatically load another page or reload the same page?

Started by ganeshbala, Mar 14, 2009, 08:20 PM

Previous topic - Next topic

ganeshbala

Automatically load another page or reload the same page?

Here are the instructions for Client-Pull method using <META>:

   1. Use <META> in the <HEAD> section of your document.
   2. Write HTTP-EQUIV and CONTENT in <META> to accomplish client-pull.

Examples
To reload the document itself:

<HEAD>
<META HTTP-EQUIV=REFRESH CONTENT=5>
</HEAD>


CONTENT=5 means wait for 5 seconds to reload the page.
To load visitors to another page:

<HEAD>
<META HTTP-EQUIV=REFRESH CONTENT="5;URL=http://mbiz.co.th/tips_tricks/">
</HEAD>


URL=http://...... This is the URL of the page you want to load a visitor to.

That's it. Is it easy? Remember that HTTP-EQUIV will work in some browsers such as Netscape 2.0 and Internet Explorer 3.0 or higher. So, don't forget to make an alternative for visitors who are using old browsers.
Another alternative is using JavaScript.

<html>
<head>
<title>Auto Reload</title>
<script language="JavaScript">
<!--
var time = null
function move() {
window.location = 'http://yoursite.com'
}
//-->
</script>
</head>
<body onload="timer=setTimeout('move()',3000)">
<p>see this page refresh itself in 3 secs.<p>
</body>


Above is an example of JavaScript that will reload a page in 3 seconds. See timer=setTimeout('move()',3000) 3000 is number of milliseconds which equals to 3 seconds.