<SCRIPT LANGUAGE="JavaScript">
<!
var maxtime =
function CountDown(){
if(maxtime>=
//minutes = Math
seconds = Math
//msg = "距離結束還有"+minutes+"分"+seconds+"秒";
msg = "距離結束還有"+seconds+"秒";
document
if(maxtime ==
alert(
}
}else{
clearInterval(timer);
//alert("時間到
maxtime=
timer = setInterval("CountDown()"
}
}
timer = setInterval("CountDown()"
//
</SCRIPT>
<div id="timer" style="color:red"></div>
<SCRIPT LANGUAGE="JavaScript">
<!
var maxtime =
var timer;
function CountDown(){
if(maxtime>=
var minutes = Math
var seconds = Math
var msg = "距離刷新還有"+minutes+"分"+seconds+"秒";
$(
//document
}else{
clearInterval(timer);
//一下兩個方法是倒計時結束後調用的方法
searchTaskList();
myajax();
//設置下一次的倒計時
maxtime=
timer = setInterval("CountDown()"
}
}
timer = setInterval("CountDown()"
//
</SCRIPT>
<div id="timer" style="display:inline;color:red"></div>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20345.html