console.log('项目启动') if (!JSON){ console.log('不支持您当前浏览器') alert('不支持您当前浏览器') }else { console.log('支持您当前浏览器') } function CookieEnable() { var result = false if (navigator.cookieEnabled) return true; document.cookie = "testcookie=yes;" var cookieSet = document.cookie if (cookieSet.indexOf("testcookie=yes") > -1 ) result=true document.cookie = "" return result } if (!CookieEnable()){ console.log('抱歉,您浏览器的Cookie功能被禁用,请开启') alert("抱歉,您浏览器的Cookie功能被禁用,请开启") }else { console.log('Cookie功能正常') } function IsPc() { var userAgentInfo = navigator.userAgent console.log('当前设备',userAgentInfo) var agents = ["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"] var flag = true for (var i=0;i 0){ //移动端 flag = false break; } } return flag } var isPc = IsPc() console.log(isPc) if (isPc){ console.log('PC端') var ele = document.getElementById("meatHtml") ele.setAttribute('http-equiv','x-ua-compatible') ele.setAttribute('content','IE=edge') } else { console.log('移动端') } // if(navigator.appName=="Microsoft Internet Explorer" && parseInt(navigator.appVersion.split(";")[1].replace(/[]/g,"").replace("MSIE",""))<9){ // //当前版本是ie并且低于ie9 // alert('您当前使用的浏览器版本过低,请更新至IE9以上') // }