父子页面怎么的传值。
给下代码 谢谢

解决方案 »

  1.   

    index.htm:<html>
      <head>
        <title>index.htm</title>
        <script type=text/javascript>
           var subPage = window.open("anotherPage.htm");
           subPage.document.getElementById("test").innerHTML = "test";
        </script>
      </head>
      <body><p></p></body>
    </html>anotherPage.htm:<html>
      <head>
        <title>anotherPage.htm</title>
      </head>
      <body><p id="test"></p></body>
    </html>
      

  2.   

     var subPage = window.open("anotherPage.htm");
     subPage 表示子页面的Window对象
    在子页面window.opener获取父页面window对象
    有了window对象就可以传值了