Home > Web Front-end > JS Tutorial > A better way to use js to determine whether the browser is IE_javascript skills

A better way to use js to determine whether the browser is IE_javascript skills

WBOY
Release: 2016-05-16 19:13:50
Original
1021 people have browsed it

The commonly used method is document.all
if(document.all){
//IE code
}else{
//Others
}

In fact, this is not enough , document.all can distinguish FireFox, but cannot distinguish Opera, because Opera supports document.all.
My current approach is:
var isIE = document.all && window.external;
...
Opera does not support window.external, so this is safer.​

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