帮我看看代码,没效果

来源:8-17 编程练习

慕粉0300152458

2016-12-08 22:48

<!DOCTYPE html>
<html>
 <head>
  <title>浏览器对象</title>  
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <style type="text/css">
      h4{font-weight:bold;
      color:red;
      }
  </style>
 </head>
 <body>
  <!--先编写好网页布局-->
  <h4>操作成功</h4>
  <input type=text id="shu"/>
  <input type=button value="返回" onclick="myfunction()" />
  <script type="text/javascript">  
  var num=5;
  function daoshu()
  {
     
      document.getElementById("shu").value=num+"秒回到主页";
      num--;
      setTimeOut("daoshu()",1000);
       if(num==1)
      {
          window.open("http://www.imooc.com","_blank");
      }
  }
     setTimeOut("daoshu()",1000);
   //获取显示秒数的元素,通过定时器来更改秒数。
    function myfunction(){
        window.history.back();
    }
   //通过window的location和history对象来控制网页的跳转。
   
 </script>
</body>
</html>

写回答 关注

1回答

  • 宸硕0
    2016-12-08 23:08:59

    setTimeout                         o 小写

JavaScript进阶篇

本课程从如何插入JS代码开始,带您进入网页动态交互世界

468782 学习 · 22507 问题

查看课程

相似问题