为什么这样不行?
<html>
<head>
<title></title>
<script type="text/javascript">
var time=document.getElementById("num").innerHTML;
function change(){
time--;
document.getElementById("num").innerHTML=time;
while(time==0){
location.replace("http://baidu.com");
}
}
setInterval("change()",1000);
</script>
</head>
<body>
<h1>操作成功</h1>
<span id="num" >5</span>
<span >秒后回到主页</span>
<a href="www.baidu.com">返回</a>
</body>
</html>