首页 > 其他 > 详细

简单明了区分IE,Firefox,chrome主流浏览器

时间:2018-10-23 12:55:22      阅读:177      评论:0      收藏:0      [点我收藏+]

简单明了判断浏览器
Firefox:
typeof navigator !== ‘undefined‘ && navigator.userAgent.toLowerCase().indexOf(‘firefox‘) > -1;

chrome

typeof navigator !== ‘undefined‘ && navigator.userAgent.toLowerCase().indexOf(‘chrome‘) > -1;

IE10 及之前

typeof navigator !== ‘undefined‘ && navigator.userAgent.toLowerCase().indexOf(‘ie‘) > -1;

IE11
typeof navigator !== ‘undefined‘ && navigator.userAgent.toLowerCase().indexOf(‘trident‘) > -1;

简单明了区分IE,Firefox,chrome主流浏览器

原文:https://www.cnblogs.com/hill-foryou/p/9835747.html

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