var childWin =window.open("")
childWin.location="http://lucky.myrice.com"
zai child里:
window.opener.document.fname.input1.value="haha"

解决方案 »

  1.   

    childWin.document.fname.inputname.value="hehe"
      

  2.   

    以上方法的确可以实现。但是我用父窗口无法控制子窗口,无法对子窗口对象赋值,请示下:
    父窗口:
    <html>
    <head>
    <script language="JavaScript">
    var childWin;
    function aa(){
     childWin=window.open("b.html");
    childwin.document.form2.input.value="dfdsf";
    }
    function ab(){
    childwin.document.form2.input.value="dfdsf";
    childwin.document.form2.write.value="写入";
      
     
    }</script><title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body bgcolor="#FFFFFF" text="#000000">
    <table width="100%" border="0">
      <tr><form name="form1" method="post" action="">
        <td width="60%"> 
          
            <input type="button" name="open" value="弹出" onclick="aa()">      
        </td>
        <td width="40%">
          
            <input type="button" value="输入" name="write"  onclick="ab()">
    <input type="text" name="textfield" value="">      
        </td></form>
      </tr>
    </table>
    </body>
    </html>
    子窗口:
    <html>
    <head>
    <script language="JavaScript">
    function aa(){
    window.opener.document.form1.open.value="open";
    window.opener.document.form1.write.value="write";
    window.opener.document.form1.textfield.value="输入";
    }
    </script>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body bgcolor="#FFFFFF" text="#000000">
    <table width="100%" border="0">
      <tr><form name="form2" method="post" action="">
        <td>
          
      <input type="button" value="输入" name="write"  onclick="aa()">
            

          
        </td>
        <td>&nbsp;<input type="text"  name="input" value=""></td>
      </form></tr>
    </table>
    </body>
    </html>