为啥不跳转,眼都花了。。。
<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</title>
<meta http-equiv="Content-Type" content="text/html; charset=gkb"/>
</head>
<body>
<!--先编写好网页布局-->
<h1>操作成功</h1>
<span id="second" >5</span>
<span >秒后回到主页</span>
<a href="javascript:back();">返回</a>
<script type="text/javascript">
var n=document.getElementById("second").innerHTML;
function count();
{
n--;
document.getElementById("second").innerHTML=n;
if(n==0)
{
location.assign("www.imooc.com");
}
}
setInterval("count()",1000);
/*function count()
{
num--;
document.getElementById("second").innerHTML=num;
if(num==0)
{
location.assign("www.imooc.com");
}
}
setInterval("count()",1000);*/
</script>
</body>
</html>