父窗口打开一个子窗口,并且父页面通过传了id给子页面,子页面提供一个模糊搜索功能,然
后点击搜索后,传过来的url就消失了,现在的问题是怎么在jsp把值传给action,action在把同样的值传回来.
以下是父窗口打开子窗口,并把id传过去
function openNewWindow(id){
window.open("<%=basePath%>user/showUserList.action?id=i_receive",'linkman',"width=260 ,height=345,top=200,left="+((window.screen.width/2)-200));
}
function openNewccWindow(id){
window.open("<%=basePath%>user/showUserList.action?id=i_cc",'linkman',"width=260 ,height=345,top=200,left="+((window.screen.width/2)-200));
}
子窗口得到id
var url = location.search;
s = url.split("=");
url = s[1];
以下是进行模糊搜索
var val = $("#searchInput").val();
window.location = "<%=basePath%>user/searchUserList.action?userName="+encodeURI(val);
请问在模糊搜索后怎么才能得到原来父窗口中传过来的那个值
你id就没有添加到window.open打开的url上。。你自己都写死了,都不是参数的id
function openNewWindow(id){
window.open("<%=basePath%>user/showUserList.action?id="+id,'linkman',"width=260 ,height=345,top=200,left="+((window.screen.width/2)-200));
}
function openNewccWindow(id){
window.open("<%=basePath%>user/showUserList.action?id="+id,'linkman',"width=260 ,height=345,top=200,left="+((window.screen.width/2)-200));
}
搜索时传递的参数也没有附带上
var url = location.search;
s = url.split("=");
url = s[1];
var val = $("#searchInput").val();
window.location = "<%=basePath%>user/searchUserList.action?userName="+encodeURI(val)+'&id='+url;
你写的时候,就是死值??参数没有传过来
你在父窗口用js定义一个全局变量,父窗口打开子窗口父串口并没有刷新。
多alert几次就可以了