在父窗口中打开一个模式窗口,当模式窗口关闭的时候父窗口不刷新.
父窗口js代码
function addDiaocha()
{
var url = '${ctx}/admin/diaocha/edit.jsp?mode=add';
var win = showModalDialog(url,'','dialogWidth:35;dialogHeight:20;center:1;status:no');
if(win == '1')
window.location.href = '${ctx}/admin/diaocha/index.jsp';
}
{
var url = '${ctx}/admin/diaocha/edit.jsp?mode=add';
var win = showModalDialog(url,'','dialogWidth:35;dialogHeight:20;center:1;status:no');
if(win == '1')
window.location.href = '${ctx}/admin/diaocha/index.jsp';
}
父窗口判断返回值是否是'1',如果是的话,父窗口刷新.
子窗口js代码
document.getElementById('myForm').submit();
window.returnValue = "1";
window.close();
window.returnValue = "1";
window.close();
本文转自 tony_action 51CTO博客,原文链接:http://blog.51cto.com/tonyaction/42037,如需转载请自行联系原作者