JavaScript:呼叫frameset中其他頁面中的函式
阿新 • • 發佈:2018-12-23
<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"> </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"> </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"> </td>
</tr>
</table>
//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"> </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"> </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"> </td>
</tr>
</table>