<html>
	<head>
	<title>流浪器对象</title>
	<meta http-equiv="Content-type" content="text/html;charset=utf-8"/>
	</head>
<body>
	<!--想编号网页布局-->
	<h1>操作成功</h1>
	<span id ="second" >5</span>
	<span>秒后回到主页</span>
	<a href = "javascript:history.back();" target ="_blank">返回</a>
	<script type ="text/javascript">
	var num=document.getElementById("second").innerHTML;
	//获取显示秒数的元素,通过定时器来更改秒数。
	function count(){
		num--;
		document.getElementById("second").innerHTML=num;
		if(num==0){
			location.assign("www.imooc.com");
		}
	}
	setInterval("count()",1000);
	//通过window的location和history对象来控制网页的跳转。
	function back(){
		window.history.back();
	}
	</script>
</body>
</html>我保存在E盘,程序运行正常,然后跳转到了file:///E:/www.imooc.com怎么搞??
加上http://也可以,location.assign("http://www.imooc.com");
<!DOCTYPE html>
<html>
 <head>
  <title>浏览器对象</title>  
  <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>   
 </head>
 <body>
  <!--先编写好网页布局-->
  <h3>操作成功</h3>
  <span id="fh"></span>秒后回到主页
  <a href="javascript:window.history.back()">返回</a>
  
 
  <script type="text/javascript">  
 
   //获取显示秒数的元素,通过定时器来更改秒数。
    var i = 5;
    var a = document.getElementById("fh");
    setInterval("timer()",1000);
   //通过window的location和history对象来控制网页的跳转。
   function timer(){
        if(i == 0){
            window.location.href=window.history.back();
        }else{
            a.innerHTML=i;  
            i--;
        }
    }
      
   
 </script> 
</body>
</html>
不是吧,这是你的代码,我这里正常。
<html>
    <head>
    <title>流浪器对象</title>
    <meta http-equiv="Content-type" content="text/html;charset=utf-8"/>
    </head>
<body>
    <!--想编号网页布局-->
    <h1>操作成功</h1>
    <span id ="second" >5</span>
    <span>秒后回到主页</span>
    <a href = "javascript:history.back();" target ="_blank">返回</a>
    <script type ="text/javascript">
    var num=document.getElementById("second").innerHTML;
    //获取显示秒数的元素,通过定时器来更改秒数。
    function count(){
        num--;
        document.getElementById("second").innerHTML=num;
        if(num==0){
            location.assign("http://www.imooc.com");
            // window.location.href =  "http://www.imooc.com/";
        }
    }
    setInterval("count()",1000);
    //通过window的location和history对象来控制网页的跳转。
    function back(){
        window.history.back();
    }
    </script>
</body>
</html>
location.assign() 是加载新的文档。是file
改成:location.href = "http://www.imooc.com/";