IE中window的模态框与返回值

window.returnValue是javascript中html的window对象的属性,目的是返回窗口值,当用window.showModalDialog函数打开一个IE的模态窗口时,用于返回窗口的值:

在父页面中使用window.showModalDialog可以弹出一个模态框

var result = window.showModalDialog("child.htm",null,"dialogWidth:350px;dialogHeight:350px;help:no;status:no");

该页面的返回值result为子页面中使用

window.returnValue = "父页面需要的数据";

来从子页面传递数据给父页面。

一般在子页面得到数据后,就会关闭子页面。

window.returnValue = "需要的数据";
window.close(); 

这样一来可以实现从模式窗口向父窗口传递值的作用

posted @ 2016-08-20 09:28  理舞  阅读(513)  评论(0编辑  收藏  举报