从一到无穷大epub:大家看看,关于刷新页面

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/27 14:43:44
我想关闭一个页面的同时刷新另一个页面,请问大家该如何实现呀?请大家给一个可行的办法,谢谢

<script>
function op(){
newopen=window.open("post.php","0","0");
setInterval('wen()',10);
}
function wen(){
if(newopen.closed){
window.location.reload();
}
}
</script>

<span style="CURSOR: hand" onclick='op()'><IMG SRC="img/post.gif" WIDTH="40" HEIGHT="20" BORDER=0 ALT="填写新的留言"></span>

关闭子窗口自动刷新父窗口

子窗口取父窗口: opener.xxxxxxxxxxxxxxx
父窗口取子窗口:window名.xxxxxxxxxxx 其中window名=window.open('index.htm')

在关闭的那个页面<body>中加句代码:
<body onunload="opener.location.reload()">