用opener在beforeunload之前找到A
将值赋过去

解决方案 »

  1.   

    直接用showModalDialog传参数即可.
    在B的Body中的onload中调用
    function Init()
    {
    if(window.dialogArguments)
    {
    var strResult=window.dialogArguments;
    }
    }
    checkbox选中激发事件中调用
    function OnOK()
    {
    window.returnValue="值";
    var outResult=window.returnValue;
    window.close();
    }
    在A中:
    var outResult=showModalDialog('','','');
    outResult就是传回的参数.
      

  2.   

    在checkbox的onclick里面激发
    opener.document.all."itemname".value=this.value;
    window.close();
      

  3.   

    following is the example
    a.htm
    <input type=button value=openwindow onclick="winopen()">
    <input type=hidden name=hidvalue>
    <script>
    function winopen()
    {
    window.open("b.htm","new window","");
    }
    </script>b.htm<input type=checkbox name=cx value="ok" onclick="startthis(this.value)">ok<script>
    function startthis(par)
    {
    opener.document.all.hidvalue.value=par;
    window.close();}
    </script>