Refresh page after counter time period over
<p>I have a script where user can edit their content in a period of time, so I added this time counter:</p>

<pre><code>  function StartCountDown(myDiv,myTargetDate)
{
var dthen   = new Date(myTargetDate);
var dnow    = new Date("&lt;?php echo $targetdate ?&gt;");
ddiff       = new Date(dthen-dnow);
gsecs       = Math.floor(ddiff.valueOf()/1000);
CountBack(myDiv,gsecs);
}

function Calcage(secs, num1, num2)
{
s = ((Math.floor(secs/num1))%num2).toString();
if (s.length &lt; 2) 
{   
  s = "0" + s;
}
return (s);
}

function CountBack(myDiv, secs)
{
var DisplayStr;

var DisplayFormat = "%%D%% %%H%%:%%M%%:%%S%%";

if(secs&gt;86400)
{

DisplayStr = DisplayFormat.replace(/%%D%%/g,    Calcage(secs,86400,100000)+' Days');

}
else
{

    DisplayStr = DisplayFormat.replace(/%%D%%/g,"");

}
if(secs&gt;3600)
{

DisplayStr = DisplayStr.replace(/%%H%%/g,       Calcage(secs,3600,24));
}
else
{


    DisplayStr = DisplayFormat.replace(/%%D%% %%H%%/g,"00");


}
DisplayStr = DisplayStr.replace(/%%M%%/g,       Calcage(secs,60,60));
DisplayStr = DisplayStr.replace(/%%S%%/g,       Calcage(secs,1,60));
if(secs &gt; 0)
{   
  document.getElementById(myDiv).innerHTML = DisplayStr;

  setTimeout("CountBack('" + myDiv + "'," + (secs-1) + ");", 990);
}
else
{
  document.getElementById(myDiv).innerHTML = "Period Over";
}
}
</code></pre>

<p>the counter is working fine, and counts the time remaining, but if the user didn't leave the page and the time remaining reached the 0 he will get this message (Period Over), and he will be able to edit his content.</p>

<p>what I'm looking for is a code instead of (Period Over) makes the pager reloaded or refreshed when the counter reached the targeted time.</p>

<p>thanks, </p>
