
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; if(isIE) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); reIE.test(userAgent); var fIEVersion = parseFloat(RegExp["$1"]); if(fIEVersion == 7) { console.log('我是IE7') } else if(fIEVersion == 8) { console.log('我是IE8') } else if(fIEVersion == 9) { console.log('我是IE9') } else if(fIEVersion == 10) { console.log('我是IE10') } else { console.log('我是IE6') } } else if(isEdge) { console.log('我是edge') } else if(isIE11) { console.log('我是IE11') }else{ return -1;//不是ie浏览器 }
悟空浏览器的秘密:如何轻松下载小说和视频?网页版入口大公开!
上面是“判断当前浏览器是不是ie,什么版本号”的全面内容,想了解更多关于 前端知识 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_2081.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

Nerd AI APP最新版
Leadde AI:一款将内容转化为专业多语言互动视频的生成式AI平台
php语法如何获取服务器操作系统(附代码)
Linux和Windows主机怎样做301跳转
Model1:DeepSeek FlashMLA代码库曝光的下一代旗舰模型雏形
智元兔AI:支持生成式AI技术,提供24小时实时问答交互服务
轻松传官网:一个多功能的文件传输和共享工具,支持文件/文本/视频