1、showModalDialog returnValue是javascript中html的window对象的属性,目的是返回窗口值,当用window.showModalDialog函数打开一个IE的模式窗口时,用于返回窗口的值 主界面 var sonValue=window.showModalDialog("son.jsp"); 子界面 window.returnValue="传值给主界面"; 子界面得到主界面值方法 (主界面) var obj = new Object(); obj="第二个参数为传值" var sonValue=window.showModalDialog("son.jsp",obj); (子界面) var obj = window.dialogArguments alert("您传递的参数为:" + obj) 2、open window.opener,是通过window.open打开子窗体的父窗体的引用 主界面 window.open("son.jsp"); 子界面获取主界面的方法和变量 window.opener.document.getElementById("username").value 可以通过调用主页面方法把子页面值传到主界面。getNewLinkValue为主界面方法 window.opener.getNewLinkValue(document.getElementById("tt").value); 3、iframe 父窗口和子窗口的调用方法 //转载开始 父窗口调用子窗口 iframe_name.iframe_document_object.object_attribute = attribute_value 例子:onClick="iframe_text.myH1.innerText='http://www.pint.com';" 子窗口调用父窗口parent_document_object.object_attribute = attribute_value 例子:onclick="parent.myH1.innerText='http://www.pint.com';" 上面在IE下没有问题,但在firefox下不正常。在firefox下,应该是 父窗口调用子窗口 window.frames["iframe_name"].document.getElementById("iframe_document_object"-).object_attribute = attribute_value 例子 window.frames["iframe_text"].document.getElementById("myH1").innerHTML= "http://www.pint.com"; 子窗口调用父窗口 parent.document.getElementById("parent_document_object").object_attribute = attribute_value 例子 parent.document.getElementById("myH1").innerHTML = "http://www.adsf.com"; //转载结束 主窗口 <IFRAME name="floater" src="iframSon.jsp" width=1000 height=600 hspace=20 vspace=20 align=right frameborder=1> </IFRAME><BR> window.frames["floater"].document.getElementById("sonId").innerHTML="父窗口改变子窗口内容"; 子窗口 parent.document.getElementById("parentId").innerHTML="子窗口改变父窗口内容"; parent.parentId.innerHTML="子窗口改变父窗口内容";