日期:2014-05-17 浏览次数:20409 次
1 父窗口:
<script type="text/javascript">
function openBrWindowInCentre(theURL,width,height) {
var left, top;
left = (window.screen.availWidth - width) / 2;
top = (window.screen.availHeight - height) / 2;
var per = 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top;
window.open(theURL,'',per);
}
</script>
<a href="javascript:void(0)" onclick="openBrWindowInCentre('child.html','600','400');">打开子窗口</a>
2. 子窗口
< script language="JavaScript" type="text/javascript">
< !--
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
{
window.opener.progressWindow.close();
}
window.close();
} //-->
< /script>
< a href="javascript:void(0)" onclick="refreshParent()">刷新父窗口并关闭当前窗口</a>