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

js method to detect browser version

大家讲道理
Release: 2016-11-10 13:33:27
Original
1550 people have browsed it

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");
        }
    }
Copy after login

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template