日期:2014-05-16  浏览次数:20360 次

子窗口向父窗口传递数据的问题
在网上找到一段代码,

a.htm
-----
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<title> 新建网页   1 </title>
</head>
<body>
<TEXTAREA       id= "content "       name= "content "       cols= "50 "       rows= "5 "> </TEXTAREA>      
    <INPUT       type= "button "       onclick= "window.showModalDialog( 'dialog.htm ',content, ' '); "       value= "Test ">
</body>

</html>


dialog.htm
---------
<html>      
       
    <script       language= "javascript ">      
       
    function       closeWin()      
    {      
       
        var       retValue       =       " ";      
       
        for(i=0;i <chkBox.length;i++)      
        {      
                            if(chkBox[i].checked)      
    retValue       +=       chkBox[i].value       +       ", ";      
        }      
       
            window.dialogArguments.value       =       retValue;      
            window.close();      
       
    }      
       
    </script>      
       
    <body>      
       
    <input       type= "checkbox "       id= "chkBox "       value= "ABC "> ABC <BR>      
    <input       type= "checkbox "       id= "chkBox "       value= "DEF "> DEF <BR>      
    <input       type= "checkbox "       id= "chkBox "       value= "GHI "> GHI <BR>      
    <input       type= "button "       value= "ok "       onclick= "closeWin(); ">      
       
    </body>      
       
    </html>

经过测试,只能支持IE,   用firefox不行,怎么才能支持firefox?

------解决方案--------------------
这个问题,几年前就有人