CHROME 子窗口 无法返回值

leoppeng 2011-11-22 04:19:58
IE正常,CHROME无法返回 在网上查了很多,都不行

--父窗口
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
function openbm()
{
var returnValue = window.showModalDialog('aa1.htm', 'window', "dialogWidth=300px;dialogHeight=300px;resizable:yes;")


alert(returnValue);

}


</script>
</head>

<body>
<form name="form1" method="post" action="">
<input type="text" name="Text1" value=""><input type="button" onClick="openbm()">
</form>
</body>
</html>


--AA1。HTM 子窗口
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">

function list()
{

window.returnValue = 'dfdsfsdfdsf';


window.close();

}

</script>
</head>

<body>
<input type= "text " name= "bb ">
<input type="button" onclick="list()">
</body>
</html>
...全文
173 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cckk263 2012-08-29
  • 打赏
  • 举报
回复
网上都是这么说的.

<html>
<head>
<title>无标题文档</title>
<script>
function aa(){
if(window.opener != undefined){
//for chrome
window.opener.returnValue = "e123";
}else{
window.returnValue = "e123";
}
window.close();
}
</script>
</head>

<body>
<input type= "text " name= "bb ">
<input type="button" onclick="aa()">
</body>
</html>

87,989

社区成员

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

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