<!DOCTYPE html>
<html>
 <head>
  <title>浏览器对象</title>  
  <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>   
 </head>
 <body>
  <!--先编写好网页布局-->
  <h1>操作成功</h1>
  <span id="b">5</span>
  <span>秒后回到主页  </span>
  <a href="javascript:backnow();">返回</a>
  
 
  <script type="text/javascript">  
  var i=document.getElementById("b").innerHTML;
 function count()
 {  
     i--:
     document.getElementById("b").innerHTML=i;
     if(i==0)
     {
         location.assign(www.immoc.com);
     }
    setInterval("count()",1000);
 }
   //获取显示秒数的元素,通过定时器来更改秒数。
   function backnow()
   {
       window.history.back();
   }
   //通过window的location和history对象来控制网页的跳转。
   
 </script> 
</body>
</html>
<script type="text/javascript">
    var i=document.getElementById("b").innerHTML;
    function count(){
        i--;
          //这里是 ; 不是 :
        document.getElementById("b").innerHTML=i;
        if(i==0){
            location.assign('http://www.immoc.com');  //这里是字符串  需要加 ‘’  网址是 http 开头的
        }
    }
    setInterval("count()",1000);  // 这个定时要放到外面  你放到count 里面,count没有被调用就不会执行
    //获取显示秒数的元素,通过定时器来更改秒数。
    function backnow(){
        window.history.back();
    }
    //通过window的location和history对象来控制网页的跳转。
</script>http://www.imooc.com/ 你还把慕课网的址给写错了
setInterval("count()",1000);要写在count函数外面
i--后面不该是冒号
location.assign(www.immoc.com);括号里要用引号