Count down time 60 refresh web page js code

  • 2020-03-30 01:49:08
  • OfStack

 
<html xmlns="http://www.w3.org/1999/xhtml"> 

<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<title>60 Refresh this page </title> 
<script type="text/javascript"> 
var t; 
t=60; 
function shua() 
{ 
t=t-1; 
document.getElementById("hints").innerHTML=" There's still time for the next refresh  "+t+"  seconds "; 
if (t==0) 
{ 
document.location.reload(); 
} 
} 
</script> 

</head> 
<body onload="window.setInterval(shua,1000);"> 
<center> 
<font id="hints" style="color:blue" > There's still time for the next refresh 60 seconds </font><br/> 
<center> 
</body> 
</html> 

Related articles: