1. 子窗口给父窗口元素赋值
<input type="hidden" id="id">
function modifyId(id){
$("#id",window.parent.document).attr("value",id);//子窗口给父窗口元素赋值
}
2. 子窗口获得父窗口的元素值
var id=$("#id",window.parent.document).val();
alert(id);
3.子窗口调取父窗口的方法
parent.test();//test() 是父窗口的方法
4.父窗口调取子窗口的方法
var x=document.getElementById("idIframe");
var y=(x.contentWindow || x.contentDocument);
y.childrenTest();//childrenTest() 是子窗口的方法