用opener,例子如下:
父窗口:
<script>
function asdf2(){
window.open("children.html","","menubar=no,left=0,top=0,width=100,height=100")
document.all.AAA.value+=2;
}
</script>
<form name="hehe">
<input id="AAA" value="1">
<input type="button" value="test" onclick="asdf2()">
</form>子窗口:
<select onchange="opener.document.all.AAA.value=this.value;window.close()">
   <option value="test1">test1</option>
   <option value="test2">test2</option>
   <option value="test3">test3</option>
</select>

解决方案 »

  1.   

    <INPUT TYPE="text" name="ptext" value=""><br>
    <INPUT TYPE="button" onclick="test()" value="弹出新窗口"><SCRIPT LANGUAGE="JavaScript">
    <!--
    function test() {
        var win = window.open("子窗体控制父窗")
        win.document.write("<body>")
        win.document.write("<input type='text' name='ctext' value=''><br>")
        win.document.write("<input type='button' value='关闭窗口' onclick='gc()'>")
        win.document.write("<SCRIPT LANGUAGE='JavaScript'>")
        win.document.write("function gc() {")
        win.document.write("window.opener.ptext.value=ctext.value;")
        win.document.write("window.close();")
        win.document.write("}</SCRIPT></body>")
    }
    //-->
    </SCRIPT>