showModalDialog一个窗口后,如何可以控制父窗口? parent.window你要怎么控制? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这样的,父窗口一个按钮点击后出现一个模式对话框,模式对话框上选择一个LIST,然后点完成。关闭模式对话框,父窗口的LIST上出现刚才在模式对话框上内容。用普通window.open可以,但是换成showModalDialog后就不行了。现有代码用的是window.opener,parent.window好像也不行。有没有其他办法了呢? showModalDialog('ttt.htm', window)在 showModalDialog 对话框里:if (window.dialogArguments != null) var w = window.dialogArguments;w.location.reload(); //父页面刷新w.document.all.objID.innerText = "meizz"; //直接给父网页里的元素赋值 这位大佬,我试用你上面的代码,出错了。location为空或不是对象 同样的代码我这里测试通过:showModalDialog('ttt.htm', window)ttt.htm:<script language="JavaScript"><!--var w;if (window.dialogArguments != null) w = window.dialogArguments;//--></script><input type=button value=ok onclick="w.location.href='other.htm'"> 找到原因了,我的调用方法是这样,和你的不同。window.showModalDialog('temp.aspx','','dialogHeight: 400px; dialogWidth: 600px; center: Yes; help: No; resizable: No; status: No;');多谢 被showModalDialog打开的窗口将中断父窗口的执行直到showModalDialog窗口被关闭 或者用showModalDialog的returnValue ExtJs横向滚动条的问题 jquery表单验证问题 javaScript中怎么使用正则表达式来验证 QQ秀上鼠标滑过图片的效果的制作 javascript的符号问题 求一个写法 我想在网站上放一些三维动画,让用户观赏,但不能下载,该怎么做?100分不够再加 JS判断容器高度,当内容超过高度,自动折行 如何制作连动表单(从几个数据库表中取记录)???? 求一下拉框联动js 请问,如何做一个让别人可以看的见但是却不能拷贝的网页? 如何让IFRAME里的form提交?请指点
用普通window.open可以,但是换成showModalDialog后就不行了。
现有代码用的是window.opener,parent.window好像也不行。
有没有其他办法了呢?
var w = window.dialogArguments;w.location.reload(); //父页面刷新
w.document.all.objID.innerText = "meizz"; //直接给父网页里的元素赋值
location为空或不是对象
showModalDialog('ttt.htm', window)ttt.htm:
<script language="JavaScript">
<!--
var w;
if (window.dialogArguments != null)
w = window.dialogArguments;
//-->
</script>
<input type=button value=ok onclick="w.location.href='other.htm'">
window.showModalDialog('temp.aspx','','dialogHeight: 400px; dialogWidth: 600px; center: Yes; help: No; resizable: No; status: No;');多谢