父頁面:
document.getElementById("childFrame").contentWindow._alert("逆時(shí)針向");
}```
子頁面:
```function prents(){
parent.chuandicanshu()
}
function _alert(text){
var _footer = document.getElementById("footer");
_footer.style.color='#333';
_footer.style.background='#0099ff';
console.log(text)
}```
父頁面通過contentWindow獲取子頁面的Window對象以進(jìn)行方法調(diào)用,
子頁面通過parent調(diào)用父頁面方法