首先 openwindow
var sonwindow = window.open(url,"son","left=400,width=800,height=520px");
父页面变量方法
<script>
var father = 'fa';
function sayhelloFather(){
alert(“hello,”+father);
}
</script>
子页面变量方法
<script>
var son = 'son';
function sayhelloSon(){
alert(“hello,”+son);
}
</script>
1.父页面调用子页面
sonwindow .son;
sonwindow .sayhelloSon();
2.子页面调用父页面
window.opener.father;
window.opener.sayhelloFather();
3.父页面判断子页面是否关闭
if(sonwindow.closed){
....
}
4.判断父窗口是否刷新或者是否已经关闭
//刷新页面时关闭弹出窗口
window.οnbefοreunlοad=function (){
closeRwdyWindow();//关闭子窗口
};