1、定义一个子窗口
new.htm<script>
function testa(){//定义子窗口的方法
}
</script>
2、定义父窗口,并调用子窗口的方法
<script>function openWindow(){
var newWindow = window.open(“new.htm”, "", "width=400,height=300 ")//打开子窗口,并返回子窗口的window
newWindow.testa()//调用子窗口的方法
}
</script>
1、打开子窗口
newWindow = window.open(“new.htm”, "", "width=400,height=300 ") //打开子窗口new.htm,并且返回子窗口的句柄window变量newWindow2、获取子窗口的值
var a= newWindow.document.getElementById("T").value//通过newWindow获取子窗口组件id是T的值如果是iframe嵌套的父页面,就用window.parent.父页面函数()如果是window.open打开的子页面,调用父页面的函数就用window.openr.函数