关于iframe窗口调用父级或同级的元素
<html>
...
<iframe id="id1">
<html>
<head>
<script type="text/javascript">
var value='';
function getValue(){
return value;
}
</script>
</head>
<body>
...
...
</body>
</html>
</iframe>
<iframe id="id2"></iframe>
<iframe id="id3"></iframe>
<iframe id="id4"></iframe>
...
</html>
在子级页面获取同级页面的其他iframe
//获取指定id的iframe
var iframe=$(parent.document).find('#id')[0];
//获取上iframe中的元素(假设在指定的iframe页面存在全局变量 value,也就是定义在JavaScript
//中的代码中定义的全局变量
var value=iframe.contentWindow.value;
//调用iframe中的全局方法
iframe.contentWindow.getValue();
在子级页面获取父级,parent就是父级,parent.value,parent.getValue 获取变量和方法
parent.document获取document获取dom