Home > Web Front-end > JS Tutorial > body text

Using JS to determine the IE version of the code is super useful! _javascript skills

WBOY
Release: 2016-05-16 18:03:37
Original
933 people have browsed it

Method 1:

Copy code The code is as follows:



Method 2:
Copy code The code is as follows:


if(navigator.userAgent.indexOf("MSIE")>0)
{
//Whether it is IE browser
if(navigator.userAgent.indexOf("MSIE 6.0") >0)
{
//6.0 Use 1.CSS
Css.innerHTML=' '
}
if(navigator.userAgent.indexOf("MSIE 7.0")>0)
{
//7.0 using 2.CSS
Css.innerHTML=''
}
}else
{
//Otherwise use 3.CSS and specific browsing You can use navigator.userAgent to obtain information. The specific usage is up to you
Css.innerHTML=''
}


Method three:
Copy code The code is as follows :







test




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