window.opener 引用父窗口,然后象处理父窗口中的对象了,与处理本窗口中的对象没什么区别。

解决方案 »

  1.   

    在本页面中定义变量xx,在弹出窗口中给它赋值opener.xx=...
      

  2.   

    你可以用
    returnvalue;value = window.open(".....");在弹出框的中按确认时:
    returnValue = ????;就可以把值传到父窗体中
      

  3.   

    楼主好,下午有事儿出去了,不知道楼主在等,抱歉呀!:)1.htm:<html>
    <head>
    <title>Untitled Document</title>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    //-->
    </script>
    </head><body>
    <form id="form1" name="form1" method="post" action="">
      <select name="select" id="dlist">
      </select>
      <input name="Button" type="button" onClick="MM_openBrWindow('2.htm','none','width=400,height=300')" value="Button">
    </form>
    </body>
    </html>2.htm:<html>
    <head>
    <title>Untitled Document</title>
    </head><body>
    <form name="form1" id="form1" method="post" action="">
      <input name="textfield" type="text" id="txtText" size="20">
      <input name="textfield2" type="text" id="txtValue" size="10">
      <input type="button" name="Button" value="add" onClick="f();">
      <script language="JavaScript" type="text/JavaScript">
    function f() {
      var doc = window.opener.document;
      var dlist = doc.form1.dlist;
      var oOption = doc.createElement("OPTION");
      dlist.add(oOption);
      oOption.innerText = document.form1.txtText.value;
      oOption.value = document.form1.txtValue.value;
      window.close();
      dlist.onresize();
    }
      </script>
    </form>
    </body>
    </html>onresize 好像不太好使,如果要做清除处理的话更麻烦些。也不知道这些对楼主是否有帮助。
      

  4.   

    用structs做,把方法写在action里就,调用对应的setXXX方法就可以了!
      

  5.   

    在js级解决,就用window.returnValue
    在后台解决,就用set/get Attribute ()