首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

兑现页面间简单的定时跳转

2012-10-29 
实现页面间简单的定时跳转htmlheadmeta http-equivContent-Type contenttext/html charsetUTF

实现页面间简单的定时跳转
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="css/common.css">
</head>
<script type="text/javascript">

var time = 3; //跳转时限
var i = 0;
function init(url){ 
document.all.s.innerHTML = time;
timer = setInterval("document.all.s.innerHTML = time - (++i)", 1000);//显示时间
timer = setTimeout("document.location.href='" + url + "'", time * 1000); //跳转
}
</script>
<body id="common" onload="init('${url}')" >
<div id="all">
操作成功  还剩<span id="s"></span>秒自动返回 <br/>
<a href="${url}" >手动返回</a>
</div>
</body>
</html>

热点排行