<!--document.form1.action="tu.jsp?bm="+str;-->
document.form1.action="tu.jsp?bm="+<%=abc%>;

解决方案 »

  1.   

    加一个隐藏控件。lz Try 一下
    <html>
    <head>
    <script language="javascript">
      function test()
         {
             var str="123";
           <!-- // document.form1.action="tu.jsp?bm=str";-->
                // document.form1.action="tu.jsp?bm=" + v;
             document.form1.submit();    
      
           }
    </script>
    </head>
    <body><%! String abc="58"; %> <form name="form1" action="tu.jsp">
        <input type="submit" value="submit" onclick="test('<%= abc %>')">
        <input type="hidden" name="bm" value="">
     </form></body>
    </html>
      

  2.   

    这一行写错了:document.form1.action="tu.jsp?bm="+<%=abc%>;改为:document.form1.action="tu.jsp?bm=<%=abc%>";