我有一个包含在页面中的带有模态窗口的struts2页面。单击按钮弹出将打开,输入值并单击提交后,弹出窗口将关闭,父页面将被刷新。
我的Jsp:弹出窗口和父程序都在同一个jsp中。
Main page
<form id="Parent">
<div id=container>
<table>
</table>
</div>
<input type="button" onclick="openPopup()">
</form>
<form id=popup>
<input type="text" id="comments">
<input type="button" id="popupBtn">
</form>Js文件
$.post("updateDB",{comments:comments}, function(){
$('#popup').dialog('close');
$('#container').load("refreshParent #container");
});更新DB和弹出关闭是有效的,但.load不工作,谁能帮助我哪里做错了。
有两件事没有调用refreshParent操作,如果调用它,我也需要刷新父表单,如何引用另一个表单的DIV id。
更新:--我忘了提到有几行复选框,在弹出窗口上单击submit时需要提交值。
提前谢谢。
发布于 2012-06-08 21:15:06
下面的代码是当您在新窗口中打开弹出时使用的。
$.post("updateDB",{comments:comments}, function(){
window.opener.location.reload();
window.close();
});所以你可以在你的案子里做些类似的事情
$.post("updateDB",{comments:comments}, function(){
$('#popup').dialog('close');
window.location.reload();
});https://stackoverflow.com/questions/10955817
复制相似问题