<a href="test.jsp?userID=3">test</a>在页面上点击test的时候可以跳转到test.jsp页面去并带着当前的请求跳转(即带着userID=3跳转)有没有什么办法实现下面的功能<a href="javascript:myDelete()"></a>javascritp代码如下function myDelete(){    在这个方法里有没有什么办法实现本文第三句话的功能}
  

解决方案 »

  1.   

    function myDelete(){     location = 'test.jsp?userID=3'; } 
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title> New Document </title>
    <meta name="Generator" content="EditPlus">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    </head><body>
    <script language="JavaScript">
    <!--
    function go(){
    window.location.href = "test.html?userID=3" ;

    }//-->
    </script><a href="#" onclick="go()">test </a> 
    </body>
    </html>