父页
vReturnValue = window.showModalDialog(sURL,window,'')
子页

opener.document.getElementById("test").value="返回值"

 

参数传递 通过vArguments来传递参数,类型不限制,对于字符串类型,最大为4096个字符,也可以传递对象,例如:

parent.htm
<script>
window.showModalDialog("sun.htm","传递进去的参数","help:no;scroll:no");
</script>
sun.htm
<script>
alert("传来的参数:" + window.dialogArguments);
</script>

 

返回值 通过window.returnValue向打开对话框的窗口返回信息,也可以是对象。例如:

parent.htm
<script>
result=window.showModalDialog("son.htm","","help:no;scroll:no");
alert(result);
</script>
son.htm
<script>
window.returnValue="这里存放返回的结果";
</script>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
猜你喜欢
  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
相关资源
相似解决方案