`

extjs 2.0.2 Ext 在ie9下报错

阅读更多

 IE9不兼容 在页面中加入

<script type="text/javascript">
if ((typeof Range !== "undefined") && !Range.prototype.createContextualFragment) {
    Range.prototype.createContextualFragment = function(html) {
        var frag = document.createDocumentFragment(),div = document.createElement("div");
        frag.appendChild(div);
        div.outerHTML = html;
        return frag;
    };
}

</script>

 

 

IE9下Tree报错

在ext-all.js下找这个getAttributeNS 方法,改为
 

getAttributeNS : Ext.isIE ? function(ns, name){
         var d = this.dom;
         var type = typeof d[ns+":"+name];
         if(type != 'undefined' && type != 'unknown'){
             return d[ns+":"+name];
         }
         return d[name];
     } : 
       

 

 --》

getAttributeNS : Ext.isIE ? function (ns, name) {  
        var d = this .dom;  
        var type = typeof d[ns + ":" + name];  
        if (type != "undefined" && type != "unknown" ) {  
          return d[ns + ":" + name]  
        }  
        type = typeof d[name];  
        if (type != "undefined" && type != "unknown" )  
        {  
          return d[name];  
        }  
        type=typeof d.getAttribute(ns + ":" + name);  
        if (type != "undefined" && type != "unknown" )  
        {  
          return d.getAttribute(ns + ":" + name);  
        }  
        type=typeof d.getAttribute(name);  
        if (type != "undefined" && type != "unknown" )  
        {  
          return d.getAttribute(name);  
        }  
        return null ;  

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics