http://expert.csdn.net/Expert/topic/1488/1488123.xml?temp=.8129084

解决方案 »

  1.   

    如父窗体pWindow.html表单中有
    <form name=f>
     <select name=s>
     </select>
     <input type=button value="add" onclick="window.open('./subWindow.html','','')">
    </form>子窗体中
    <script>
     var ff=Array("1111","2222");
     /**
      这里怎么写
    */
    </script>
    希望执行后为
    <select name=s>
      <option>1111
      <option>2222
     </select>
      

  2.   

    <form name=f>
     <select name=s>
     </select>
     <input type=button value="add" onclick="window.open('b.htm','','')">
    </form>
    <script>
    function ad(txt,value){
    with(document.f.s)
    options[length]=new Option(txt,value)
    }
    </script>
    b.htm:
    <script>
     var ff=Array("1111","2222");
    function ad(){
    var ss=opener.document.f.s
    for(i=0;i<ff.length;i++)
    opener.ad(ff[i])
    }
    </script>
    <input onclick="ad()" type=button value="add">