子窗口向父窗口传递数据的问题

suisuibianbian 2007-07-10 09:17:06
在网上找到一段代码,

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?
...全文
239 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
hbhbhbhbhb1021 2007-07-10
  • 打赏
  • 举报
回复
那用层了,不过层也有些东西会把这个东西屏蔽掉的
mh_rock 2007-07-10
  • 打赏
  • 举报
回复
window.open用这个可能会被屏蔽
rjzou2006 2007-07-10
  • 打赏
  • 举报
回复
可以使用window.open来实现
hongqi162 2007-07-10
  • 打赏
  • 举报
回复
FireFox中你可以使用window.open来实现


ref


http://www.80x86.cn/article.asp?id=1276
hongqi162 2007-07-10
  • 打赏
  • 举报
回复
这个问题,几年前就有人提交到了 Mozilla 的 Bugzilla,请见 Bug 194404

在最初 MozillaSuite 中(Firefox 是从这个套件衍生),是支持 showmodaldialog() 的,不过后来发现 showmodaldialog() 存在安全隐患,不久后就取消了对 showmodaldialog() 的支持,这个事情还发生在 bug 194404 提交前。在想出更好的解决方案前,相信 Firefox 是不会提供对 showmodaldialog() 的支持的。
hy_lihuan 2007-07-10
  • 打赏
  • 举报
回复
呵呵,不是很清楚

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧