如何每小时刷新页面
大家好,
我必须每个小时刷新一次页面,例如(1,2,3 ..... 24).
请帮忙
Mohd Wasif
Hi all,
I have to refresh a page at each hours e.g(1,2,3.....24).
Please help
Mohd Wasif
尝试以下操作:
Try this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
// <![CDATA[
function bed(){
var now = new Date();
var hr = now.getHours();
var targ = document.getElementById('time_alert');
targ.firstChild.nodeValue = (hr <= 23) ? hr+"00 Hours. You're good!!" : hr+"00 Hours. You need to go to bed";
setTimeout('bed()', 3600000);
}
onload = bed;
// ]]>
</script>
</head>
<body>
<span id="time_alert"> </span>
</body>
</html>
否则请查看以下链接以供参考:
刷新页面 [每个定义的时间间隔的自动回发或刷新页面 [
Or else have a look on following link for reference:
Refresh a page[^]
Auto Postback or Refresh page for every defined time interval[^]
您可以使用元标记来实现以下目的:
Hi,
You can use meta tag to achieve this:
<meta http-equiv="refresh" content="3600">
这里的内容是刷新页面的秒数.
http://www.mindfiresolutions.com/Autorefresh-an-ASPNET-aspx- web-page-37.php [ ^ ]
自动刷新网页 [ http://www.grizzlyweb.com/webmaster/javascripts/refresh.asp [ ^ ]
Here content is number of seconds after which page will be refreshed.
http://www.mindfiresolutions.com/Autorefresh-an-ASPNET-aspx-web-page-37.php[^]
Auto Refresh Web Page[^]
http://www.grizzlyweb.com/webmaster/javascripts/refresh.asp[^]