关闭showModalDialog打开的窗口,原来的页面无刷新

<script>
var username=document.getElementById("username").value;
var v_emplogin=document.getElementById("hf_emplogin").value;
function OnQueryClick()
{

var address = "SYS/SYS_ADVICEINPUT.aspx?username="+username+"&emp_login="+v_emplogin;
var parameter1='';
var OpenStyle = "center:Yes;dialogWidth:650px;dialogHeight:550px;status:no";
var returnValue = window.showModalDialog(address,parameter1,OpenStyle);

}
</script>
这是我打开模态窗口的方法

主窗体中打开模态窗体的JS代码: 通过它的返回值手动刷新主窗体

function openWin(n)
{
var returnValue=window.showModalDialog('bianji.aspx?id='+n+'','','scrollbars=no;resizable=no;help=no;status=no;dialogHeight=500px;dialogwidth=700px;center=yes');
if (returnValue==1)
{
window.location.reload();
}
}

在模态窗体中 在后台的onclick事件中JS代码如下:

Response.Write(" <script >alert( '修改成功!');window.returnValue=1;window.close(); </script > ");
温馨提示:答案为网友推荐,仅供参考