Javascript refresh + countdown text -


i using following javascript in header refresh page

    <script type="text/javascript"> <!-- function timedrefresh(timeoutperiod) {     settimeout("location.reload(true);",timeoutperiod); } //   --> </script> 

and in body tag

<body onload="javascript:timedrefresh(5000);"> 

my question how add text showing countdown refresh page

x seconds refresh

does suit needs?

(function countdown(remaining) {     if(remaining <= 0)         location.reload(true);     document.getelementbyid('countdown').innerhtml = remaining;     settimeout(function(){ countdown(remaining - 1); }, 1000); })(5); // 5 seconds 

jsfiddle


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -