js判断360浏览器 兼容模式IE版本
var ms_ie = false; var ua = window.navigator.userAgent.toLowerCase(); var old_ie = ua.indexOf('MSIE'); var new_ie = ua.indexOf('trident/'); var is360 = false; var append = document.getElementById("append"); if((old_ie > -1) || (new_ie > -1)) { ms_ie = true; } if(window.navigator.appName.indexOf("Microsoft") != -1) { me_ie = true; } if((window.navigator.mimeTypes[40] || !window.navigator.mimeTypes.length)) { is360 = true; } if(ms_ie) { var DEFAULT_VERSION = 8.0; var ua = navigator.userAgent.toLowerCase(); var isIE = ua.indexOf("msie")>-1; var safariVersion; if(isIE){ safariVersion = ua.match(/msie ([\d.]+)/)[1]; } if(safariVersion <= DEFAULT_VERSION ){ alert('系统检测到您正在使用ie8以下内核的浏览器,不能实现完美体验,请更换或升级浏览器访问!') } }