浏览器判断是ie
作者:互联网
let userAgent = navigator.userAgent; let isIE = userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1; let isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1; let isEdge = userAgent.indexOf('Edg/') > -1; if(isIE || isIE11 || isEdge ){ // 如果是ie都弹出 alert("是ie!!!") }
标签:判断,浏览器,indexOf,isIE11,isIE,let,userAgent,ie 来源: https://www.cnblogs.com/hushunv/p/15964727.html