为兼容ie、firefox特别做了如下处理:
if(navigator.appName == "Netscape") {//firefox等兼容
document.getElementById("historyframe").contentDocument.getElementById("ChatList").innerHTML +="abc";
}else{//ie兼容
document.frames("historyframe").ChatList.innerHTML +="abc";
}
注意,这里的的“ChatList”是chatList.jsp中的div:<div id='ChatList'></div>
<iframe name="historyframe" id="historyframe" style="margin-left:0;margin-right:0px;background-color:ivory;" frameborder="0" width="100%" height="100%" src="<%=path %>/jsp/customer/chatList.jsp"></iframe>
其他iframe资料:
Firefox 和 IE JavaScript兼容性
url:http://pengchb2002.blog.163.com/blog/static/1618824120085171132903/
1.iframe 调用子页面的函数
IE:iframeId.function
FF:document.getElementById("iframeId").contentWindow.function
ps:FF: window 为contentWindow; document 为contentDocument
2.class 属性
IE:obj.setAttribute("className","style");
FF:obj.setAttribute("class","style");
3.获取document.scrollHeight权限出错
通过Iframe操作scroll相关属性和行为时,如果src的资源和父页面不部署在同一应用下,会报此错误
学习HTML:iframe用法总结
url:http://blog.csdn.net/BiologyPianoProgram/archive/2009/04/23/4103062.aspx
真正的iframe高度自适应(兼容IE,FF,Opera)
url: http://540079673.blog.163.com/blog/static/12071647620103211042804/
分享到:
相关推荐
因为有一个项目要用到iframe自适应高度,网上搜索了以下结果无数,不过看来看去都是那...iframe自适应高度,亲测完美兼容IE6_7_8_9,Chrome谷歌浏览器,Opera欧朋浏览器,FireFox火狐浏览器,Mac Safari浏览器等五大浏览器
代码如下: [removed] function getIframeContent(){ //获取iframe中文档内容 var doc; if (document.all){//IE doc = document.frames[“MyIFrame”].document; }else{//Firefox doc = document.getElementById(...
父画面取得iframe内的控件值 兼容ie firefox
这里是因为firefox windows.top如果没有那么就是空,在IE下windows.top就是本窗口 页面不断的刷新 不断的运行这段js代码这就造成了一个死循环,也是为什么页面一直在刷新. 所以我更改了方式,使用下面这段代码 兼容...
NULL 博文链接:https://cjb.iteye.com/blog/406466
同域时Iframe高度自适应 下面的代码兼容IE/Firefox浏览器,控制id为“iframeid”的iframe的高度,通过JavaScript取得被嵌套页面最终高度,然 后在主页面进行设置来实现。 代码如下,可复制。另外,
iframe自适应高度兼容各主流浏览器,经本人亲手测试。 通过测试的浏览器:IE/Firefox/Chrome/Opera/Safari 注:此方法不支持DOM动态操作 版本太旧,自行选择
NULL 博文链接:https://kev1n.iteye.com/blog/1222483
iframe高度自适应,多浏览器兼容 已测试过在ie6,7,8,firefox8,chrom15中通过
兼容火狐和IE插入图片的js代码,IE9不兼容showModalDialog的处理方法。
修改Calendar日历控件 兼容IE9,谷歌,火狐。 只是能用,出现的位置有所不同,希望有高手再帮我改改吧,谢谢 一、 代码如下: this.iframe = window.frames(”meizzCalendarIframe”); 修改为 代码如下: this....
让iframe自适应高度(支持xhtml)IE firefox兼容
本文实例讲述了JS实现兼容火狐及IE iframe onload属性的遮罩层隐藏及显示效果。分享给大家供大家参考,具体如下: <%@ page language=java import=java.util.* pageEncoding=GB2312%> <% String path...
主要介绍了JS实现iframe编辑器光标位置插入内容的方法,可实现文本与图片的插入功能,并兼容IE和Firefox浏览器,需要的朋友可以参考下
主要介绍了js实现iframe框架取值的方法,可兼容IE,firefox,chrome等浏览器.涉及JavaScript针对框架元素取值的相关技巧,需要的朋友可以参考下
本文实例讲述了JS实现pasteHTML兼容ie,firefox,chrome的方法。分享给大家供大家参考,具体如下: <html> <body> [removed] function test() { if (document.selection && document.selection....