java代码和js两种方式判断浏览器是否是IE11
< 返回列表时间: 2019-06-20来源:OSCHINA
【围观】麒麟芯片遭打压成绝版,华为亿元投入又砸向了哪里?>>> java代码判断浏览器是否是IE11 HttpServletRequest request = ServletActionContext.getRequest(); String agent = request.getHeader("User-Agent"); //判断是IE浏览器而且不是IE11的时候 if (version.equals("WPS") && request.getHeader("User-Agent").toUpperCase().indexOf("MSIE") == -1 && !(null != agent && -1 != agent.indexOf("like Gecko"))) { System.out.print("是IE浏览器而且不是IE11"); } js判断浏览器是否是IE11 var u = window.navigator.userAgent.toLocaleLowerCase(), ie11 = /(trident)\/([\d.]+)/, style = u.match(ie11); if(style){ alert("该浏览器是ie11"); }
热门排行