java代碼判斷瀏覽器是不是IE11javascript
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判斷瀏覽器是不是IE11java
var u = window.navigator.userAgent.toLocaleLowerCase(), ie11 = /(trident)\/([\d.]+)/, style = u.match(ie11); if(style){ alert("該瀏覽器是ie11"); }