window.opener.document.form1.filenam.value = filename
注意上面的代码,javascript,这里window.opener指向父窗口,研究一下如何用把

解决方案 »

  1.   

    1.html
    =================
    <html>
    <head>
    <title>Example</title>
    </head>
    <script>
    function xx(){
    window.open("2.html","");
    }
    function inst()
    {
    document.form1.select1.options[0]=new Option('aaa','aaa',0,0)
    }
    </script>
    <body>
    <form name="form1">
      <select name="select1">
      </select>
    <input type="button" onclick=xx() value="click">
    </form>
    </body>
    </html>============
    2.html
    ====================
    <html>
    <head>
    <title>Example</title>
    </head>
    <body>
    <script>
    window.opener.inst()
    window.opener.focus()
    self.close()
    </script>
    </body>
    </html>