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

javascript使用定時(shí)函數(shù)實(shí)現(xiàn)跳轉(zhuǎn)到某個(gè)頁(yè)面

 更新時(shí)間:2013年12月25日 16:41:06   作者:  
定時(shí)跳轉(zhuǎn)到某個(gè)頁(yè)面,比如跳轉(zhuǎn)到一個(gè)頁(yè)面處理完任務(wù),然后又回到原來的頁(yè)面,這個(gè)用javascript的定時(shí)函數(shù)很容易實(shí)現(xiàn)
有時(shí)我們跳轉(zhuǎn)到一個(gè)頁(yè)面處理完任務(wù),然后又回到原來的頁(yè)面,這個(gè)在很多的下載網(wǎng)站可以看到,這樣做也是為了留住用戶。

這個(gè)用javascript的定時(shí)函數(shù)很容易實(shí)現(xiàn)。

window.setTimeout( code,time) // code 執(zhí)行的代碼 time 設(shè)置的時(shí)間
復(fù)制代碼 代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>javascript自動(dòng)跳轉(zhuǎn)</title>
<script type="text/javascript">
function redrect()
{
window.location = "1.html";
}
window.setTimeout(redrect,3000);// 跳轉(zhuǎn)函數(shù)
</script>
</head>
<body >
<h4 style="color:#F00">這是跳轉(zhuǎn)頁(yè)面....</h4>
</body>
</html>

相關(guān)文章

最新評(píng)論