需求是这样的a.html是通过b.html页面打开
a.html和b.html各有一个textbox,txta和txtb
点击b.html里的按钮将txtfb的值传入a.html的txta,并关闭 b.html

解决方案 »

  1.   

    参考
    http://topic.csdn.net/u/20090706/15/e156b3d4-6732-4a6f-8c81-110fc12759cd.html
      

  2.   

    caller.html <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Caller</title>
    <script type="text/javascript">
    function openPage(elem, page){
    var loading = document.createElement('span');
    loading.innerHTML = 'loading';
    var arg = {
    window: window,
    input: document.getElementById('input')
    };
    window.showModalDialog(page, arg, 'titlebar:no;status:no;dialogWidth:300px;dialogHeight:300px');
    }
    </script>
    </head>
    <body>
    <a hre="#" onclick="openPage(this, 'input.html');" style="cursor:hand">open</a>
    <textarea id="input"></textarea>
    </body>
    </html>input.html <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript">
    var arg = window.dialogArguments;
    window.onload =function(){
    var done = document.getElementById('done'),
    input = document.getElementById('input');
    done.onclick = function(){
    arg.input.value = input.value;
    window.close();
    }
    }
    </script>
    </head>
    <body>
    <textarea id="input"></textarea>
    <input type="button" id="done" value="done" />
    </body>
    </html>
      

  3.   

    老子通过url传值,将值传给儿子,然后关闭自己~~
    或者,儿子被打开之后,去获取老子页面上的那个控件值,通过windows.opener.document....
    思路就这样~