<script>
var seconds = 4;
var defaultUrl = "http://news.sina.com.cn";
onload = function()
{
setInterval(redirection, 1000);
}
function redirection()
{
if (seconds <=0) {
clearInterval();
// location.href = defaultUrl;
return;
}
seconds --;
document.getElementById("spanSeconds").innerHTML = seconds;
if (seconds ==0) {
clearInterval();
// location.href = defaultUrl;
}
}
//坐标
function getEvent() {
status ="鼠标的x坐标:" + event.screenX + "\n" + "鼠标的y坐标:" + event.screenY ;
}
document.onmousemove = getEvent;
</script>
<div>
如果您不做出选择,将在<span id="spanSeconds"></span>秒后跳转到第一个链接地址。
</div>