有如下代码:

//java代码

[html] view plain copy
  1. <%String parm="hello word"%>  
[html] view plain copy
  1. //html代码  
  2. <input type="hidden" id="test" value="<%=parm%>">  
  3. //js代码  
  4. <script type="text/javascript">  
  5. var req=document.getElementById("ddm").value;  
  6. </script>  
[html] view plain copy
  1.   
[html] view plain copy

如此这般就轻易获取到页面中的参数了。

相关文章: