Auto-Refresh Page

 How to refresh my page every 5 min ? Can someone help me ?
LVL 1
quanghocAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
freshmeatConnect With a Mentor Commented:
add this line on the beginning of your page:
<META HTTP-EQUIV="REFRESH" CONTENT=300>

0
 
HencahCommented:
Hi,

You can use script to do that, try this:

<html>
<body>
<SCRIPT LANGUAGE=javascript>
<!--
  alert('reload in action') // just a sign of life
  setInterval('location.reload(true)',1000)
//-->
</SCRIPT>
</body>
</html>

I use reload function with parameter true, it means that it will force to get the page from the server not from local cache.
Put that script into any place in the body tag.

...but it may not work in Netscape, change setInterval with setTimeout and location.reload('true') with location.href='yourpage.htm' and it'll work the same.

Good Luck
0
 
HencahCommented:
oops change the interval like this:

setInterval('location.reload(true)',300000)

5 min = 5*60*1000 msec
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
quanghocAuthor Commented:
 To freshmeat,
 I don't know how it works ? Why "300" ? Where should I put it ?
 
  To Hencah,
 Could you please tell me specifically how to do this in Netscape ? I've already done it very well in IE.

  Thanks, you guy.
0
 
freshmeatCommented:
ha, 5min * 60sec = 300 sec, ok?
my code can run on every browser
:D
it is a HTML gramma
0
 
HencahCommented:
to run in Netscape:

<SCRIPT LANGUAGE=javascript>
<!--
  alert("reload in action") // just a sign of life
  setTimeout("location.href='thispageagain.asp'",30000)
//-->
</SCRIPT>

to make freshmeat's works put that meta tag in the head section,like this:

<html>
<head>
<META HTTP-EQUIV="REFRESH" CONTENT=300>
</head>
....

and that tag (meta) add info into page header, the choice is up to you

Good Luck :)

0
 
quanghocAuthor Commented:
  Thanks.
0
All Courses

From novice to tech pro — start learning today.