<html>
<head>
<title>自动跳转</title>
</head><body>
<span id="spanSeconds"></span>
</body>
</html>
<script language="JavaScript">
<!--
var seconds = 3;
var defaultUrl = "http://www.google.cn";
onload = function() {
window.setInterval(redirection, 1000);
}
function redirection(){
if (seconds <= 0) {
window.clearInterval();
return;
}
seconds --;
document.getElementById('spanSeconds').innerHTML = seconds;
if (seconds == 0)
{
window.clearInterval();
location.href = defaultUrl;
}
}
//-->
</script>