1.通过url路径传递参数
var name=‘job‘;
var age=18;
window.open($.WEB_ROOT+ ‘/nihao/search/infomation.jsp?name=‘+name+‘&age=‘+age);
jsp中页面抓取
<script type="text/javascript">
$(function() {
var name= ‘<%=request.getParameter("name")%>‘;
var age= ‘<%=request.getParameter("age")%>‘;
}
});
</script>
2.js抓取参数
在当前JSP中设置一个隐藏的<div>
<div id="search" style="display:none">
</div>
$("#searchCondition").val(window.opener.document.getElementById("search").value);
时间: 2024-10-06 17:04:41