展示当前时间差 60 秒并刷新页面的JavaScript函数
发布时间:2023-10-17 15:01:19 所属栏目:教程 来源:
导读:代码如下:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>60刷新本页</title>
<script type="tex
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>60刷新本页</title>
<script type="tex
代码如下: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>60刷新本页</title> <script type="text/javascript"> var t; t=60; function shua() { t=t-1; document.getElementById("hints").innerHTML="离下次刷新时间还有 "+t+" 秒"; if (t==0) { document.location.reload(); } } </script> </head> <body onload="window.setInterval(shua,1000);"> <center> <font id="hints" style="color:blue" >离下次刷新时间还有60秒</font><br/> <center> </body> </html> (编辑:聊城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐