假设a.html和b.html在同一个文件夹下面,用javascript实现当打开a.html五秒钟后,自动跳转到b.html。

解决方案 »

  1.   

    可以在几个地方写代码1、<body   onload="setTimeout('form1.submit()',2000)">   
      <form   action=b.htm   method=post   name=form1>   
      </form>
    2、<META   HTTP-EQUIV="Refresh"   CONTENT="5;URL=b.html">3、<script>   
      setTimeout('form1.submit()',2000);   
      </script>
       同 1 一样 构建个form1
      

  2.   

    setTimeout('location.href = b.html',5000);   
      

  3.   

    <html>
    <head>
    <script language="javaScript">
    function openUrl(){
     window.open("test2.html");
    }function loadHtml(){
     window.setTimeout("openUrl()",5000);}
    </script>
    </head>
    <body onload="loadHtml()">
    </body>
    </html>
    这样就可以了