1. 程式人生 > >JavaScript:呼叫frameset中其他頁面中的函式

JavaScript:呼叫frameset中其他頁面中的函式

<script language="javascript">
//alert(window.parent.document.getElementById("topFrame").document.getElementById("mc"));
function changeTalk(username){
self.parent.topFrame.test(username);
}
</script>

<body id="center">
<div id="mcc" display="none"><div>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="8" bgcolor="#353c44">&nbsp;</td>
    <td width="147" valign="top"><iframe height="100%" width="100%" border="0" frameborder="0" src="left.html" name="leftFrame" id="leftFrame" title="leftFrame"></iframe></td>
    <td width="10" bgcolor="#add2da">&nbsp;</td>
    <td valign="top"><iframe height="100%" width="100%" border="0" frameborder="0" src="right.html" name="rightFrame" id="rightFrame" title="rightFrame"></iframe></td>
    <td width="8" bgcolor="#353c44">&nbsp;</td>
  </tr>
</table>