function url() 

 alert('点击跳转 test2.html'); 
document.form1.action="test2.html";
document.form1.submit();[

解决方案 »

  1.   

       <script> 
       function Jump()
       {  
        window.alert("JumpToBaidu");
    window.location.href='http://www.baidu.com'   } 
       </script> 
       <input type="button" onclick="Jump()" value='ToBaidu'/>  
      

  2.   

    <input type=button value=hehe onclick="location.href='test2.html'">
      

  3.   


          function url()
          {
            if(confirm("跳转到test2.html么?"))location.href="http://www.baidu.com";
          }
          url();
    这个还是用confirm比较好吧!
      

  4.   

    用onClick="javascript:windows.location.href="test2.html"
      

  5.   

    看下面的代码:test1.html <html> 
    <head> 
    <title>test1 </title> 
    </head> 
    <body> 
    <form name ="form1"> 
    <input type="name" value=""/> 
    <br/> 
    <input type="button" name="button" onclick="if(confirm('点击跳转test2.html'){location.href="test2.html";return true;}else{ return fasle;})"> 
    </form> 
    </body> 
    </html> 
    test2.html 
    <html> 
    <head> 
    <title>test1 </title> 
    </head> 
    <body> 
    <form name ="form2"> 
    跳转成功 
    </form> 
    </body> 
    </html>