在ie6下面没有问题
父页面:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>father</title>
<script>
window.onload = function(){
alert("init");
}
function showChildWindow(){
window.showModalDialog("child.html",window,'dialogHeight=500px;dialogWidth=750px;status=no;help=no;resizable=yes');
//history.go(0);

}
</script>
</head>
<body>
<input type="button" value="father" onclick="showChildWindow()"/>
</body>
</html>子页面:child.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Child</title>
<script>
function closeAndFresh(){
top.dialogArguments.location.reload();
//window.parent.dialogArguments.document.execCommand('Refresh');
window.close();
}
</script>
</head>
<body>
<h1>Child!!!</h1>
<input type="button" value="Close" onclick="closeAndFresh();"/>
</body>
</html>top.dialogArguments.location.reload();
window.parent.dialogArguments.document.execCommand('Refresh');
window.parent.dialogArguments.history.go(0);
都不起作用,但是在ie6和firefox都没有问题,麻烦大家给出个在ie7下面也可以自动刷新的方法,谢谢

解决方案 »

  1.   

    window.location.reload();IE7,FF3.0下没问题
      

  2.   

    function closeAndFresh(){ 
      window.dialogArguments.location.reload(); 
      window.close();
    }
      

  3.   

    谢谢,本页面的window.location.reload();是都没有问题,父页面就不行了
    window.dialogArguments.location.reload(); 也试过的,不行
      

  4.   

    解决了,还要在子页面<body onUnload="window.dialogArguments.location.reload()">就可以了
      

  5.   

    那就在父页面写个yourReloadFn方法
    然后子页面window.dialogArguments.yourReloadFn();不就好了