欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

5秒后跳轉(zhuǎn)到另一個頁面的js代碼

 更新時間:2013年10月12日 08:48:32   作者:  
跳轉(zhuǎn)到另一個頁面的方法有很多,在本文將為大家詳細(xì)介紹下js中如何實現(xiàn)5秒后跳轉(zhuǎn)到另一個頁面,感興趣的朋友可不要錯過
復(fù)制代碼 代碼如下:

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>5秒后跳轉(zhuǎn)到另一個頁面</title>

<script type="text/javascript">
var t = 5;
function countDown(){
var time = document.getElementById("time");
t--;
time.value=t;
if (t<=0) {
location.;
clearInterval(inter);
};
}
var inter = setInterval("countDown()",1000);
//window.onload=countDown;
</script>

</head>
<body onload="countDown()">

<input type="text" readonly="true" value="5" id="time"/>

<!--也可以在這里寫javascript代碼,這樣就不必在body標(biāo)簽中寫onload="countDown()"。-->
</body>
</html>

相關(guān)文章

最新評論