日期:2014-05-16  浏览次数:20411 次

javascript 简单倒计时
<html>
<body>
页面将在<span id='remaining_time'></span>秒后自动跳转...
</body>
<script type="text/javascript">
var remaining_time = document.getElementById('remaining_time');
var t = 6;
function changeTime(){
	t--;
	remaining_time.innerHTML="&nbsp;"+t+"&nbsp;";
	if(t==0){
			window.location.href = 'http://www.baidu.com';
			return;
	}
	setTimeout('changeTime()', 1000);
}
changeTime();
</script>
</html>

?