opener.show();
父窗体需要顶一个show() 方法
父面页代码:
html.html
<script> <br><br>window.onload=function(){ <br><br>var btn = document.getElementById("btn"); <br><br>btn.onclick = openPage; <br><br>function openPage(){ <BR>try { <BR>window.open('newpage.html'); <BR>}catch(e){ <BR>alert(e); <BR>} <BR>//alert("ok"); <BR>} <BR>} <BR>function show(){ <BR>document.title=new Date(); <BR>} <BR></script>
newpage.html 代码 需要打开的页面
newpage.html
<script> <br><br>function fun(){ <BR>opener.show(); <BR>} <br><br></script>