iframe 在 ff 浏览器的显示问题 DOM对象引用格式不对parent.frames.HtmlEditor不一定能够活动正确的对象引用,你在网上找兼容的方法吧。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我在网上搜过一些,可是在ff里仍然实现不了象这个又不知道怎么用:Mozilla支持通过IFrameElmRef.contentDocument访问iframe的document对象的W3C标准;而IE要求用户通过document.frames[ "IframeName "]获取它,再访问结果中的document。 我把frames.HtmlEditor.document.write ('<font color=blue>aaa</font><br>bbb');改成这样:window.frames["HtmlEditor"].document.write ('<font color=blue>aaa</font><br>bbb'); 在ie里行,在ff里也还是不行 标准访问子窗体document代码:document.getElementById("dataLoader").contentWindow.document;window.frames["frameName"].document window.frames["HtmlEditor"].document.write ('<%="<font color=blue>"&rs("time")&"</font><br>"&rs("content")%>');window.frames["HtmlEditor"].document.write ('<input name="cc" type="hidden" value="<%="<font color=blue>"&rs("time")&"</font><br>"&rs("content")%>" size="8">');window.frames["HtmlEditor"].document.body.style.fontSize="10pt";window.frames["HtmlEditor"].document.close(); 楼上的方法我用过,在ie 里可以实现,在 ff 里就失效了 HtmlEditor is the iframe's name, not id//window.frames["frame_name"] 你试一试下面的办法: document.write ('<iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'); document.getElementById("dataLoader").contentWindow.document 上面发错,下面可能能用在FF上,不过你还要写出兼容的才行。document.write(' <iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1> </iframe> ');var myIfram=document.getElementById("HtmlEditor").contentWindow.documentmyIfram.write ('<%="<font color=blue>"&rs("time")&"</font><br>"&rs("content")%>');myIfram.write ('<input name="cc" type="hidden" value="<%="<font color=blue>"&rs("time")&"</font><br>"&rs("content")%>" size="8">');myIfram.body.style.fontSize="10pt";myIfram.close(); 多谢sq_zhuyi 。 原来把id换成name 就行了请问这一段该怎么修改?<script>parent.log.innerHTML='<iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'parent.frames.HtmlEditor.document.write ('<%=content%>');parent.frames.HtmlEditor.document.body.style.fontSize="10pt";parent.frames.HtmlEditor.document.close();</script><span id=log></span> 非常感谢xdspower 的帮助,用你的方法也可以实现兼容ff了请帮我再看看这段还需怎样修改:<script>parent.log.innerHTML='<iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'parent.frames.HtmlEditor.document.write ('<%=content%>');parent.frames.HtmlEditor.document.body.style.fontSize="10pt";parent.frames.HtmlEditor.document.close();</script><span id=log></span> 我这样改了还是不对:<script>parent.document.getElementById("log").innerHTML='<iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'window.parent.frames["HtmlEditor"].document.write ('<%=content%>');window.parent.frames["HtmlEditor"].document.body.style.fontSize="10pt";window.parent.frames["HtmlEditor"].document.close();</script><span id=log></span>在ie里正常,在ff里没显示内容 我尝试了这个,同样在ie里可以正常,在ff里还是没内容<script>parent.document.getElementById("log").innerHTML='<iframe id="HtmlEditor2" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'var myIfram=parent.document.getElementById("HtmlEditor2").contentWindow.document myIfram.write ('<%=content%>'); myIfram.body.style.fontSize="10pt"; myIfram.close();</script><span id=log></span> 你在firefox下安装一个firebug的调试扩展工具来调试吧,很好用的,可以设置断点什么的,还可以看到dom的具体情况。 frames取的是name,DOM取的是ID。 改变div的大小 Js代码不能感应 javascript基础问题,点击按钮改变innerhtml? 跪求各路高手帮忙,关于添加影片地址的问题 麻烦改下,一个页面 多个焦点图 随机执行其中一个 一个执行 其他的停止 怎样修改一个表格属性,才能隐藏表格其中的一行 如何将XMLDocument文件写入xml文件(在线等) 新手请教:click了没有反应! 简单的问题? 但对我来说就..... setRequestHeader()方法在不同浏览器中的问题 两种方式的页面跳转有什么区别 捕獲對象并click之?
Mozilla支持通过IFrameElmRef.contentDocument访问iframe的document对象的W3C标准;而IE要求用户通过document.frames[ "IframeName "]获取它,再访问结果中的document。
改成这样:window.frames["HtmlEditor"].document.write ('<font color=blue>aaa</font><br>bbb');
在ie里行,在ff里也还是不行
document.getElementById("dataLoader").contentWindow.document;
window.frames["frameName"].document
window.frames["HtmlEditor"].document.write ('<input name="cc" type="hidden" value="<%="<font color=blue>"&rs("time")&"</font><br>"&rs("content")%>" size="8">');
window.frames["HtmlEditor"].document.body.style.fontSize="10pt";
window.frames["HtmlEditor"].document.close();
//window.frames["frame_name"]
document.write ('<iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'); document.getElementById("dataLoader").contentWindow.document
document.write(' <iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1> </iframe> ');
var myIfram=document.getElementById("HtmlEditor").contentWindow.documentmyIfram.write ('<%="<font color=blue>"&rs("time")&"</font><br>"&rs("content")%>');
myIfram.write ('<input name="cc" type="hidden" value="<%="<font color=blue>"&rs("time")&"</font><br>"&rs("content")%>" size="8">');
myIfram.body.style.fontSize="10pt";
myIfram.close();
<script>
parent.log.innerHTML='<iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'
parent.frames.HtmlEditor.document.write ('<%=content%>');
parent.frames.HtmlEditor.document.body.style.fontSize="10pt";
parent.frames.HtmlEditor.document.close();
</script>
<span id=log></span>
请帮我再看看这段还需怎样修改:
<script>
parent.log.innerHTML='<iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'
parent.frames.HtmlEditor.document.write ('<%=content%>');
parent.frames.HtmlEditor.document.body.style.fontSize="10pt";
parent.frames.HtmlEditor.document.close();
</script>
<span id=log></span>
<script>
parent.document.getElementById("log").innerHTML='<iframe id="HtmlEditor" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'
window.parent.frames["HtmlEditor"].document.write ('<%=content%>');
window.parent.frames["HtmlEditor"].document.body.style.fontSize="10pt";
window.parent.frames["HtmlEditor"].document.close();
</script>
<span id=log></span>
在ie里正常,在ff里没显示内容
parent.document.getElementById("log").innerHTML='<iframe id="HtmlEditor2" MARGINHEIGHT=1 MARGINWIDTH=1 height="100" width=100% frameborder=1></iframe>'
var myIfram=parent.document.getElementById("HtmlEditor2").contentWindow.document
myIfram.write ('<%=content%>');
myIfram.body.style.fontSize="10pt";
myIfram.close();
</script>
<span id=log></span>