iframe的访问对于mozilla的兼容性问题
<body class="BodyColorSystem">
<form action="#" method="post" name="MyFORM1">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<iframe frameborder=0 width=0 height=0 id='ifrmASWebSpellCtrl1' src='http://localhost/Spellform/ifrmASWebSpellCtrl1.html' ></iframe>
<INPUT name='SpellChk.x'
onclick="DoSpellASWebSpellCtrl1('MyFORM1','TextBox1','TEXTAREA1');"
type='button' value='CheckSpelling' style='background-color: #CCFFCC; border: #333333; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width:1px; font-family: "Arial";cursor:hand'>
<SCRIPT LANGUAGE='JavaScript'>
<!--
function DoSpellASWebSpellCtrl1()
{
if (navigator.appName=="Microsoft Internet Explorer")
{
alert(top.document.frames('ifrmASWebSpellCtrl1').document.all.SPELLDATA.TextBox1.value)
}
else
{
try
{
//alert(parent.document.getElementById("ifrmASWebSpellCtrl1").name)
alert(top.document.frames('ifrmASWebSpellCtrl1').document.all.SPELLDATA.TextBox1.value)
}catch(e)
{alert(e)}
}
}
//-->
</SCRIPT>
<A HREF="#" onClick="DoSpell()"></A>
</td>
</tr>
</table>
</form>
</body>
ifrmASWebSpellCtrl1.html内容如下
<html><head>SpellCheck</head><body>
<FORM name='SPELLDATA'>
<INPUT name='TextBox1' type='hidden' value="This is test">
</FORM>
</body></html>
我想从ifrmASWebSpellCtrl1 读出 TextBox1的值.在ie中没有问题.但在mozilla firefox中和netscape
中就取不出来.我try了一下.看这些浏览器对iframe的取值可能同ie不同.
请各位大侠指点.