今天弄了一天了,終于在網上找到了解決辦法
注意:問題是在父頁面調用子頁面的方法。。。。。
父頁面:parent.html
function callChild() {
child.window.childFunction();
/*
child 為iframe的name屬性值,
不能為id,因為在FireFox下id不能獲取iframe對象
*/
}
</script>
</head>
<body>
<input type="button" name="call child" value="call child" onclick="callChild()"/>
<br/><br/>
<iframe name="child" src="./child.html" ></iframe>
</body>
</html>
function callParent() {
parent.parentFunction();
}
</script>
</head>
<body>
<input type="button" name="call parent" value="call parent" onclick="callParent()"/>
</body>
</html>
新聞熱點
疑難解答