Home > Web Front-end > JS Tutorial > How to determine the browser IE 6 7 8 9

How to determine the browser IE 6 7 8 9

php中世界最好的语言
Release: 2018-03-09 15:28:10
Original
1719 people have browsed it

This time I will bring you how to judge the IE 6 7 8 9 of the browser. What are the precautions for judging the IE 6 7 8 9 of the browser? The following is a practical case, let’s take a look. .

<script type="text/
javascript
">
        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=="MSIE6.0")
        {            window.location.href = &#39;http://xlhuang.top/browser/&#39;;
        }        
else
 if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0")
        {            window.location.href = &#39;http://xlhuang.top/browser/&#39;;
        }        else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE8.0")
        {            window.location.href = &#39;http://xlhuang.top/browser/&#39;;
        }        else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE9.0")
        {            window.location.href = &#39;http://xlhuang.top/browser/&#39;;
        }    </script>
Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to the php Chinese website

Other related articles!

Related reading:

How to solve the BUG of IE11 textarea not wrapping

How to make Vue Es6 parse to Es5 syntax

The above is the detailed content of How to determine the browser IE 6 7 8 9. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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