zoukankan      html  css  js  c++  java
  • JS 用window.open()函数,父级页面如何取到子级页面的返回值?

    父窗口:
    <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { // alert($("test1").val()); // $("#text").val($("test1").val()); $("#Button1").click(function () { var win = window.open("../WebForm1.aspx", null, " height=300,width=450, Left=300px,Top=20px, menubar=no,titlebar=no,scrollbar=no,toolbar=no, status=no,location=no"); }); } ); </script> </head> <body> <form id="form1" runat="server"> <div> <input name="text" id="text1" type="text" /><input type="button" id="Button1"/> <asp:Button ID="Button2" runat="server" Text="Button" /> </div> </form> </body> </html>

    子窗口:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
      <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
        <title></title>
        <script type="text/javascript">
    
            function Button1_onclick() {
                window.opener.$("#text1").val("ddd");
                //            alert(window.opener.$("#text1").val());
                self.close();
            }
    
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
         <input type="submit" id="Button1" onclick="return Button1_onclick()" />
        </div>
        </form>
    </body>
    </html>
    

      

  • 相关阅读:
    java操作生成jar包 和写入jar包
    jboss配置jndi连接池
    windows 域的LDAP查询相关举例
    LDAP error Code 及解决方法
    HDU 6417
    CF1299D Around the World
    codechef Chef and The Colored Grid
    Educational Codeforces Round 82 (Rated for Div. 2)
    CF1237F Balanced Domino Placements
    CF1254E Send Tree to Charlie
  • 原文地址:https://www.cnblogs.com/wangzhenghua/p/3854217.html
Copyright © 2011-2022 走看看