如何每小时刷新页面 [英] How to refresh a page on each hour

查看:71
本文介绍了如何每小时刷新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我必须每个小时刷新一次页面,例如(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">&nbsp;</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[^]


这篇关于如何每小时刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆