<script language="javascript">
var secs = 3; //倒计时的秒数
var URL ;
function Load(url){
URL = url;
for(var i=secs;i>=0;i--)
{
window.setTimeout('doUpdate(' + i + ')', (secs-i) * 1000);
}
}
function doUpdate(num)
{
$(".timeSpan").html(num +'S后自动返回');
if(num == 0) { window.location = URL; }
}
</script>
调用函数:
Load(“url”);
<div>
<span class="timeSpan"></span>
</div>