js 刷新父窗体以及禁止重新打开新页面

如果用open方法打开的窗体可以使用

window.opener.location.reload();

如果用window.showModalDialog("../HtmlUpload.aspx?key=param",obj,"dialogWidth=400px;dialogHeight=200px");

可以在子窗体中返回一个值

window.returnValue = 1;

然后在父窗体中接收

 var res=window.showModalDialog("../HtmlUpload.aspx?key=param",obj,"dialogWidth=400px;dialogHeight=200px");
             if(res=='1')
            {
            window.location=location;
            }

禁止在子窗体中重新打开页面

<head runat="server">
    <base target="_self" />

</head>

在head中添加<base target="_self" />

posted @ 2013-01-31 14:29  猪特曼  阅读(312)  评论(0)    收藏  举报