[英]Reset javascript page refresh value after jquery ajax action
If certain conditions are met I use a jquery ajax query to display a message on a page. 如果满足某些条件,我将使用jquery ajax查询在页面上显示一条消息。 When I click close on the message it disappears.
当我单击关闭消息时,它消失了。 I also have some javascript on the same page that automatically refreshes the page after 30 seconds.
我在同一页面上也有一些JavaScript,可在30秒后自动刷新页面。 What I'm trying to do is when I click close on the message it resets the automatic refresh back to 30 seconds.
我要做的是,当我单击关闭消息时,它将自动刷新重置为30秒。
tried this? 试过这个吗?
mytimeout = setTimeout("alert('refreshing page')", 30000);
And then on button click do: 然后在按钮上单击执行:
clearTimeout(mytimeout);
mytimeout = setTimeout("alert('refreshing page')", 30000);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.