父页面:1.jsp
<html>
<head>
<script language='Javascript'>
function openOverlayDialog(url, label, width, height)
{
$('#dialogIFrame').attr('src', url);
$('#overlay-dialog').dialog(
{
enter code here autoOpen: false,
modal: true,
width: width,
height: height,
title: label,
close: function () {
$('#dialogIFrame').attr('src', '');
}
});
$('#overlay-dialog').dialog("open");
}
function refreshSubmit()
{
document.refreshForm.submit();
}
function submitAddForm()
{
openOverlayDialog('2.jsp', 'addserver', '500', '260');
}
</script>
</head>
<body>
<input type="hidden" name="server" value="machinename">
<input type="button" value="submit" onClick="javascript:submitAddForm()" >
<form name="refreshForm" action="servers.do"></form>
</body>
</html>
子页面:2.jsp
<html>
<head>
<script language="JavaScript">
function refreshParent()
{
parent.refreshSubmit();
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" onload="javascript:refreshParent()" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
</body>
</html>
我通过调用openOverlayDialog函数打开覆盖对话框(子窗口),如1.jsp.In子页面的html主体(2.jsp)所示,我写了onload = refreshParent()来刷新父页面但问题是子窗口(覆盖对话框)在刷新父页面时会被关闭。任何人都可以建议,如何刷新父页面而不关闭jquery中的叠加对话框(子窗口)?