zoukankan      html  css  js  c++  java
  • 作业:按钮控制打开关闭新窗口及新窗口按钮关闭父窗口

    父窗口 a.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>父窗口</title>
    </head>
    
    <body>
    
    <input type="button" value="打开新窗口" onclick="zi=window.open('b.html', '子窗口','width=300,height=300 top=50,left = 100, scrollbars=yes, resizeable=yes, toolbar=yes,menubar=yes,location=yes');" />
    
    <input type="button" value="关闭子窗口" onclick="zi.close();" />
    
    
    </body>
    

     子窗口 b.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head>
    
    <body>
    <input type="button" value="关闭父窗口" onclick="window.opener.close();">
    </body>
    </html>
    
  • 相关阅读:
    22 有序化模块
    21模块
    Day20 继承
    Day19 约束
    面向对象 成员
    面向对象01
    内置函数、匿名函数、递归、二分法
    生成器函数 推导式
    Unity3D 实现方块跑酷
    day30-2018-12-3-进程
  • 原文地址:https://www.cnblogs.com/dirgo/p/4963334.html
Copyright © 2011-2022 走看看