<html>
<head>
<script type="text/JavaScript">
function ShowBack()
 {
 location="http://www.google.com/"
 }
</script>
</head>
<body>
This is a smiple application!
<script type="text/JavaScript">
alert("这里是会运行的");
setTimeout(ShowBack,2000);
</script>
</body>
</html>

解决方案 »

  1.   

    <html>
    <head>
    <script type="text/JavaScript">
    function ShowBack()
     {
     location.replace="http://www.google.com/"
     }
    </script>
    </head>
    <body>
    This is a smiple application!
    <script type="text/JavaScript">
    alert("这里是会运行的");
    setTimeout("ShowBack()",2000);
    </script>
    </body>
    </html>
      

  2.   

    <body>里面写成这个试下
    <body  onload=test()>
    This is a smiple application!
    <script type="text/JavaScript">
    function test(){
    alert("这里是会运行的");
    setTimeout("ShowBack()",2000);
    }
    </script>
    </body>
      

  3.   

    <html>
    <head>
    <script type="text/JavaScript">
    function ShowBack()
     {
     location.href="http://www.google.com/"//replace换成这句href
     }
    </script>
    </head>
    <body>
    This is a smiple application!
    <script type="text/JavaScript">
    alert("这里是会运行的");
    setTimeout(ShowBack,2000);
    </script>
    </body>
    </html>