- 1、本文档共14页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
ie和firefox兼容(Ie compatible with Firefox)
ie和firefox兼容(Ie compatible with Firefox)
IE and Firefox are compatible,.Txt and handsome men shake hands, talk to deep men, talk more with successful men, and live with ordinary men. Today, when testing the code, I found a lot of IE running Ajax, but it was wrong in FF.
The incompatibility and unifying methods of IE and Firefox (Firefox) in JavaScript are summarized below:
1. compatible with Firefox outerHTML, no outerHtml method in FF.
If (window.HTMLElement) {
HTMLElement.prototype.__defineSetter__ (outerHTML, function (sHTML) {
VaR, r=this.ownerDocument.createRange ();
R.setStartBefore (this);
Var df=r.createContextualFragment (sHTML);
This.parentNode.replaceChild (DF, this);
Return sHTML;
});
HTMLElement.prototype.__defineGetter__ (outerHTML, function () {
Var attr;
Var attrs=this.attributes;
Var str= +this.tagName.toLowerCase ();
For (VaR i=0; iattrs.length; i++) {
Attr=attrs[i];
If (attr.specified)
Str+= , +attr.name+=, +attr.value+;
}
If (... This.canHaveChildren)
Return str+ ;
Return str+ +this.innerHTML+ / +this.tagName.toLowerCase (+) ;
});
HTMLElement.prototype.__defineGetter__ (canHaveChildren, function () {
Switch (this.tagName.toLowerCase ()) {
Case area:
Case base:
Case BASEFONT:
Case col:
Case frame:
Case HR:
Case img:
Case br:
Case input:
Case isindex:
Case link:
Case meta:
Case param:
Return false;
}
Return true;
});
}
2. set class object problem
Description: IE, you can use (or) [] gets a collection of objects; Firefox, can only use [] gets a collection object.
Solution: unified use [] gets a collection object.
3. custom attribute issues
Explanation: under IE, you can use custom properties to obtain custom attributes, or you can use getAttribute () to get custom attributes; under Firefox, you can only use getAttribute () to obtain custom attributes
Solution: unified access to custom attributes through getAttribute ()
4.eval (idName) problem
Description: IE, you can use Eval (idName) or getElementById (idName) to obtain ID for the idName HTML o
您可能关注的文档
- 2011年青浦区高三化学一模试卷(附答案)(Qingpu District in 2011 the first mock exam papers of Senior Chemistry (with answers)).doc
- 2011微博营销发展方向漫谈(2011, micro-blog marketing development direction).doc
- 2011湖南衡阳物理试题(2011 Hunan Hengyang physics examination).doc
- 2011总结(2011 summary).doc
- 2011申论热点剖析人肉有哪些信誉好的足球投注网站案暴露民事立法之不足(Analysis on 2011 hot spots human flesh search case exposed a lack of civil legislation).doc
- 2011福建高考满分作文(2011 Fujian college entrance examination scores).doc
- 2011考研必备考研英语每年都出现的单词(2011, postgraduate entrance examination must English for postgraduate entrance examination every year).doc
- 2011护士资格考试资料(2011 nurse qualification examination data).doc
- 2011考研生应做好生理和心理上的双重准备(2011, postgraduate students should do both physical and psychological preparation).doc
- 2011锦城教育(2011 Jincheng Education).doc
- 企业级数据治理平台助力国家电网全业务数据中心建设(58页 PPT).pptx
- 2025年春全品作业本七年级语文下册人教版安徽专版答案.pdf
- 2025年春全品作业本七年级历史下册人教版安徽专版答案.pdf
- 2025年春全品作业本七年级语文下册人教版河南专版答案.pdf
- 2025年春全品作业本七年级历史下册人教版陕西专版答案.pdf
- 2025年春英语作业本七年级英语下册人教版答案.pdf
- 2025年春全品作业本七年级历史下册人教版山西专版答案.pdf
- 2025年春全品作业本七年级历史下册人教版河南专版答案.pdf
- 2025年春同步教材解析三步讲堂六年级语文下册人教版答案.pdf
- 2025年春全品作业本七年级道德与法治下册人教版内蒙古专版答案.pdf
文档评论(0)