• js子窗口向父窗口传值


    用opener

    这是一个父窗口~

    <html>
    <head>
    <title>
    </title>
    <script language="javascript">
    function win(){
       window.open("login.html",null,"height=150,width=200");
    }

    </script>
    </head>
    <table id="t1">
    <tr><td id="dd">user</td></tr>
    <tr><td id="bb">sex</td></tr>
    </table>
    <input type="button" value="提交" onclick="win()"/>
    </html>

    下面是一个子窗口

    <html>
    <head>
    <title>
    </title>
    <script language="javascript">
    function win(){

       window.opener.document.all.dd.innerText=document.getElementByIdx("user").value;
       window.opener.document.all.bb.innerText=document.getElementByIdx("sex").value;

       window.close();
    }

    </script>
    </head>
    <body>
    user:
    <input type="text" name="user"/>
    <br>sex:
    <input type="text" name="sex"/>
    <br>
    <input type="button" value="提交" onclick="win()"/>
    </body>
    </html>

  • 相关阅读:
    C#连接MySQL
    国双面试题
    Redis入门安装配置
    vs2013密钥
    单例模式
    用R画韦恩图
    Snipaste截图
    秩和检验
    用R包中heatmap画热图
    OTU(operational taxonomic units),即操作分类单元
  • 原文地址:https://www.cnblogs.com/hongjiumu/p/2660704.html
Copyright © 2020-2023  润新知