user-agent

Detect IE version (prior to v9) in JavaScript

╄→гoц情女王★ 提交于 2019-11-25 22:48:01
问题 I want to bounce users of our web site to an error page if they\'re using a version of Internet Explorer prior to v9. It\'s just not worth our time and money to support IE pre-v9 . Users of all other non-IE browsers are fine and shouldn\'t be bounced. Here\'s the proposed code: if(navigator.appName.indexOf(\"Internet Explorer\")!=-1){ //yeah, he\'s using IE var badBrowser=( navigator.appVersion.indexOf(\"MSIE 9\")==-1 && //v9 is ok navigator.appVersion.indexOf(\"MSIE 1\")==-1 //v10, 11, 12,

Auto detect mobile browser (via user-agent?) [closed]

别说谁变了你拦得住时间么 提交于 2019-11-25 22:26:42
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . How can I detect if a user is viewing my web site from a mobile web browser so that I can then auto detect and display the appropriate version of my web site? 回答1: Yes, reading the User-Agent header will do the trick. There are some lists out there of known mobile user agents so