Home > Web Front-end > JS Tutorial > body text

js specific implementation code for calling the parent window_javascript skills

WBOY
Release: 2016-05-16 17:28:45
Original
989 people have browsed it

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>


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template