我的代码哪出问题呢了
<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</title>
<meta http-equiv="Content-Type" content="text/html; charset=gkb"/>
</head>
<body>
<!--先编写好网页布局-->
<h1><strong>操作成功</strong></h1>
<span id="block">5</span><span>秒后回到首页</span><a href="window.history.back()">返回</a>
<script type="text/javascript">
function second(){
document.getElementById("block").innerHTML=var num;
num=5;
num--;
if(num==0){
location.href("www.imooc.com");
}
}
setInterval("second()",1000);
为什么秒不变呢