父窗口页面:
<html>
<head>
<script type="text/javascript">
function hello(){
alert("parent.html------>I'matparent.html");
}
function callChild()
{
//myFrame是iframe的name
//myFrame.window.functionName();
myFrame.window.hello(); //父窗口掉子窗口hello方法
}
</script>
</head>
<body>
<input type="button" value="调用子窗口hello方法" οnclick="callChild()">
<iframe name="myFrame" src="child.html"></iframe>
</body>
</html>
子窗口页面
<html>
<head>
<script type="text/javascript">
function hello()
{
alert("child.html--->I'matchild.html");
}
function callParent(){
// parent.functionName();
parent.hello(); //子窗口掉父窗口hello方法
}
</script>
</head>
<body>
<input type="button" value="调用父窗口hello方法"οnclick="callParent()">
</body>
</html>