<!DOCTYPE html>
<html>
<head>
<script>
function load()
{
window.setInterval(function(){
var time = --document.getElementById('timer').innerHTML;
if (time == 0)
{
window.location.href="www.baidu.com";
}
document.getElementById('timer').innerHTML = time;

},1000);
}

function leave()
{
window.location.href="www.baidu.com";
}

</script>
</head>

<body onload="load();">

<p>错误页面,<span id="timer">5</span>秒后会自动跳转到其他页面</p>
<a href="#" style="color:red" onclick="leave();">点击自动离开页面</a>
</body>
</html>

 

posted on 2014-04-03 16:20  苏荷酒吧  阅读(158)  评论(0)    收藏  举报