您現在的位置: 18luck新利全站下载 >> 行業分類>> IT行業>> 資料信息

IE與Firefox兼容論述(doc 8頁)

所屬分類:
IT行業
文件大小:
195 KB
下載地址:
相關資料:
ie, fire
IE與Firefox兼容論述(doc 8頁)內容簡介
IE與Firefox兼容論述內容提要:
IE和Firefox(火狐)在JavaScript方麵的不兼容及統一方法總結如下:
1.兼容firefox的 outerHTML,FF中沒有outerHtml的方法。
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;iattr=attrs[i];
if(attr.specified)
str+=" "+attr.name+'="'+attr.value+'"';
……
..............................

Baidu
map