为什么不自动跳转,需要手动才能跳转
<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</title>
<meta http-equiv="Content-Type" content="text/html; charset=gkb" />
<style type="text/css">
</style>
</head>
<body>
<h4>操作成功</h4>
<p><span id="time">5</span>秒后回到主页<a href="javascript:history.back()">返回</a></p>
<script type="text/javascript">
var num = document.getElementById("time").innerHTML
var i = setInterval("if(num > 1){document.getElementById('time').innerHTML = --num;}else{location.assign('http://www.imooc.com');}", 1000);
</script>
</body>
</html>