<script type="text/javascript">
function back(){
var num = document.getElementById("hid").value;
document.getElementById("hid").value = --num;
var value = document.getElementById("hid").value;
document.getElementById("num").innerHTML ="<font color='red'>"+value+"</font>";
}
window.setInterval('back()',1000)
</script><body onload="setTimeout('window.history.back()', 3000)">
<input type="hidden" value="3" id="hid">
<span id="num">3</span> 秒自动返回刚才页面!
</body>
<!--
用到window对象的setTimeout() 方法和setInterval() 方法。setTimeout()方法设置暂停,改方法有两个参数,执行的指定代码和暂停的毫秒数;要取消未执行的暂停,调用clearTimeout()方法。setInterval()方法用于每隔指定的时间间隔,重复执行指定的代码;参数同上,取消调用clearInterval()方法。
-->
function back(){
var num = document.getElementById("hid").value;
document.getElementById("hid").value = --num;
var value = document.getElementById("hid").value;
document.getElementById("num").innerHTML ="<font color='red'>"+value+"</font>";
}
window.setInterval('back()',1000)
</script><body onload="setTimeout('window.history.back()', 3000)">
<input type="hidden" value="3" id="hid">
<span id="num">3</span> 秒自动返回刚才页面!
</body>
<!--
用到window对象的setTimeout() 方法和setInterval() 方法。setTimeout()方法设置暂停,改方法有两个参数,执行的指定代码和暂停的毫秒数;要取消未执行的暂停,调用clearTimeout()方法。setInterval()方法用于每隔指定的时间间隔,重复执行指定的代码;参数同上,取消调用clearInterval()方法。
-->
function back(){
var num = document.getElementById("hid").value;
document.getElementById("hid").value = --num;
var value = document.getElementById("hid").value;
document.getElementById("num").innerHTML ="<font color='red'>"+value+"</font>";
}
var id = window.setInterval('back()',1000);
</script><body onload="back()">
<input type="hidden" value="4" id="hid">
<span id="num">3</span> 秒自动返回刚才页面!
</body><script>
setTimeout('clearInterval(id)',3000);
</script>
function back(){
var num = document.getElementById("hid").value;
document.getElementById("hid").value = --num;
var value = document.getElementById("hid").value;
document.getElementById("num").innerHTML ="<font color='red'>"+value+"</font>";
}
var id = window.setInterval('back()',1000);
</script><body onload="setTimeout('clearInterval(id)',3000)">
<input type="hidden" value="3" id="hid">
<span id="num">3</span> 秒自动返回刚才页面!
</body>