首页 > Web开发 > 详细

JS如何判断IE和火狐与Chrome浏览器

时间:2015-08-05 12:27:44      阅读:152      评论:0      收藏:0      [点我收藏+]
var isIE=navigator.userAgent.toUpperCase().indexOf("MSIE")?true:false; 

var isFirefox=navigator.userAgent.toUpperCase().indexOf("Firefox")?true:false;

var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1

例:
var isIE=navigator.userAgent.toUpperCase().indexOf("MSIE")==-1?false:true;
if(isIE) document.getElementById("abc").style.display="";

JS如何判断IE和火狐与Chrome浏览器

原文:http://www.cnblogs.com/hailexuexi/p/4704117.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!