var isIE = function(ver){ var b = document.createElement('b'); b.innerHTML = '

Home  >  Article  >  Web Front-end  >  How is the IE version determined?

How is the IE version determined?

零下一度
零下一度Original
2017-06-26 09:59:411381browse

Judgment of each version of IE



But there are still some flaws: ie10 and 11 can’t judge

is higher than ie9



         ///isIE 10
  }
   

Determine whether the browser is an ie browser. Use this line of code if (window.ActiveXObject || "ActiveXObject" in window) to determine the browser type. If it is an IE browser, it returns true, otherwise it returns false. In the case, an alert pop-up box will pop up to show whether it is an IE browser.

<script></p> <p>function test(){</p> <p> if (window.ActiveXObject || "ActiveXObject" in window){</p> <p>  alert(" ie")</p> <p> }else{</p> <p>  alert("not ie")</p> <p> }</p> <p>}</p> <p></script>

jquery determines ie version and browser

function JudgeBroswer() { 
        if($.browser.msie) { 
            alert("this is msie!"); //IE
        } 
        else if($.browser.safari) 
        { 
            alert("this is safari!"); //Safari 
        } 
        else if($.browser.mozilla) 
        { 
            alert("this is mozilla!");  //Firefox
        } 
        else if($.browser.opera) { 
            alert("this is opera");     //Opera
        } 
}

The above is the detailed content of How is the IE version determined?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What are the rules for writing code in web development?Next article:What are the rules for writing code in web development?

Related articles

See more