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://ipkd.cn/webs_2081.html
workflows工作流
一个破旧的工厂,一个骷髅雕像
一个人一条船一条鱼ComfyUI工作流
一张皮卡丘向观众眨眼的逼真照片ComfyUI工作流
一个戴着破旧莎帽子的机械忍者站在冰林中
一个纸杯蛋糕ComfyUI工作流
一棵白色心形流苏树comfyui工作流
一个十几岁的美国女孩穿着黄色连帽衫在黑暗和空虚的背景下闲逛
树枝上一只色彩斑斓的小鸟
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!