如何制作倒数计时器?
当用户加载页面时,时钟开始倒计时,到达时间后,它将浏览器重定向到新页面。
找到这个,用处不大。 http://encosia.com/2007/07/25/display-data-updates-in-real-time-with-ajax/
最佳答案
是这样的吗?
<div id="countDiv"></div>
<script>
function countDown (count) {
if (count > 0) {
var d = document.getElementById("countDiv");
d.innerHTML = count;
setTimeout (function() { countDown(count-1); }, 1000);
}
else
document.location = "someotherpage.html";
}
countDown(5);
</script>
关于c# - 倒计时器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2835087/