Home  >  Article  >  Web Front-end  >  Using JS to determine the IE version of the code is super useful! _javascript skills

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

WBOY
WBOYOriginal
2016-05-16 18:03:37931browse

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




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