如何每60秒自动刷新页面...? [英] How to Page Refresh automatically for every 60 sec...?

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

问题描述



我需要每60秒刷新一次网页,然后重定向到另一个页面,而无需对该页面进行任何操作.如果正在对页面执行任何操作,则不会刷新并且不会将其重定向到另一页面.

例如,取3个网页.
第1页上没有出现错误,持续60秒自动重定向到第2页.
第2页上没有出现错误,持续60秒自动重定向到第3页,
如果正在进行任何操作,请不要重定向到其他网页.

如何使用javascript在客户端编写?

如果有人知道此信息,请回复我.

问候
Nanda Kishore.CH

Hi,

I need web page refresh for every 60sec and redirect to another page on without operation on page. If am doing any operation on page not refreshed and not redirected to another page.

For example take 3 webpages.
There is no opeartion on page 1 for 60 sec automatically redirect to page2.
There is no opeartion on page 2 for 60 sec automatically redirect to page3,
If there is doing any operation not redirect to another webpage.

How to write in client side using javascript ?

If any one know about this Reply me.

Regards
Nanda Kishore.CH

推荐答案

您可以设置JS超时时间:
You can set JS timeOut:
var timeout = setTimeout(callback);



问题是您认为什么是操作".点击?按键?
您可以为每个事件附加回调:




Problem is what you consider an ''operation''. Click? Key press?
You can attach callback for every event you want:



().click(函数(){ clearTimeout(timeout); });
().click(function(){ clearTimeout(timeout); });



如果使用DevExpress,则可以使用ASPxTimer控件.



If you using DevExpress you can use ASPxTimer control.


还可以使用meta标记进行刷新,如下所示.

You can also use meta tag for refreshing as shown below.

<meta id="refreshRate" runat="server" http-equiv="refresh" content=""/>

>

现在,我们已为该元标签指定了ID,您就可以在后台代码中访问代码并进行设置或重置了.



Now that we have given id to this meta-tag, you can access in code-behind and set or reset.

refreshRate.Content = "2";



这里是2秒间隔

-Milind



Here 2 is seconds interval

-Milind


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

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