zoukankan      html  css  js  c++  java
  • JS火狐与IE的差别

    function isIE(){ //ie? 
           if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
              return true; 
           else 
              return false; 
        } 
    
        if(!isIE()){ //firefox innerText define
            HTMLElement.prototype.__defineGetter__("innerText", function(){
                var textRange = this.ownerDocument.createRange();  
                textRange.selectNodeContents(this);  
                return textRange.toString();  
                
                var anyString = "";
                var childS = this.childNodes;
                for(var i=0; i<childS.length; i++){
                   if(childS[i].nodeType==1)
                     anyString += childS[i].tagName=="BR" ? '
    ' : childS[i].innerText;
                   else if(childS[i].nodeType==3)
                     anyString += childS[i].nodeValue;
                }
                 return anyString;
           }); 
           HTMLElement.prototype.__defineSetter__("innerText",function(sText){ 
              this.textContent=sText; 
           }); 
        }
  • 相关阅读:
    Linux 实战
    bash 环境配置及脚本
    Linux vi/vim
    Linux 正则表达式
    001 KNN分类 最邻近算法
    测序名解
    流式细胞术
    CircRNA 环化RNA
    笔记总结
    Flume
  • 原文地址:https://www.cnblogs.com/xcai/p/3238795.html
Copyright © 2011-2022 走看看