Home  >  Article  >  Web Front-end  >  js method to detect browser version

js method to detect browser version

大家讲道理
大家讲道理Original
2016-11-10 13:33:271491browse

function check(){
        var browser=navigator.appName
        var b_version=navigator.appVersion
        var version=b_version.split(";");
        var trim_Version=version[1].replace(/[ ]/g,"");
        if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE10.0")
 
        {
            alert("IE 10.0");
        }
            else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0")
        {
            alert("IE 6.0");
        }
    }

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:js upload image previewNext article:js upload image preview