function SetBaceTime() { var doc =window.document.all("span_rows").innerText; var time = 60; if(doc.split('倒計時:').length>1) time = doc.split(':')[1]*1; window.document.all("span_rows").innerText ='重新取得資料,請稍等......倒計時:'+(time-1); timeIndex = setTimeout("SetBaceTime()",1000);
<body></body>
<script language="javascript">
var reload = function()
{
window.location.reload(true);
}; var startTimer = function(event)
{
window.setTimeout(reload, 300000);
}; if (window.addEventListener)
{
window.addEventListener('load', startTimer, false);
}
else if (window.attachEvent)
{
window.attachEvent('onload', startTimer);
}
</script>
{
var doc =window.document.all("span_rows").innerText;
var time = 60;
if(doc.split('倒計時:').length>1)
time = doc.split(':')[1]*1;
window.document.all("span_rows").innerText ='重新取得資料,請稍等......倒計時:'+(time-1);
timeIndex = setTimeout("SetBaceTime()",1000);
}