在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下面也可以自动刷新的方法,谢谢
父页面:
<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下面也可以自动刷新的方法,谢谢
window.dialogArguments.location.reload();
window.close();
}
window.dialogArguments.location.reload(); 也试过的,不行
然后子页面window.dialogArguments.yourReloadFn();不就好了