父页面代码:
function add() { var url = ctx + "/add"; var winArgs="dialogWidth=470px;dialogHeight=450px;status=0;help=0;"; window.showModalDialog(url,window,winArgs); }
上面代码指定第二个参数为window
子页面处理代码:
<script type="text/javascript"> $(function() { $(".submitBtn").click(function() { var url = ctx + '/addStudent'; var para=$('#stuForm').serialize(); $.post(url, para, function(data) { if(data == "yes"){ alert("添加成功!"); } else if(data == "no"){ alert("添加失败!"); } else { alert("系统出错!"); } window.close(); dialogArguments.location.reload(true); }); }); }); </script>
dialogArguments.location.reload(true);
实现刷新效果