Home >Common Problem >How to determine the browser type on mobile phone (JavaScript)
Introduces in detail the JavaScript mobile terminal to determine the browser type. Currently, it mainly supports Android, Apple, iPad, WeChat and Alipay. Whether it is the mobile terminal.
This article mainly introduces in detail a simple example of how to determine the browser type on the JavaScript mobile phone. It has certain reference value and can be used for reference.
Determine the browser type on the mobile phone
BrowserInfo = { isAndroid: Boolean(navigator.userAgent.match(/android/ig)), isIphone: Boolean(navigator.userAgent.match(/iphone|ipod/ig)), isIpad: Boolean(navigator.userAgent.match(/ipad/ig)), isWeixin: Boolean(navigator.userAgent.match(/MicroMessenger/ig)), isAli: Boolean(navigator.userAgent.match(/AlipayClient/ig)), isPhone: Boolean(/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) }
Currently it mainly supports Android Apple iPad WeChat Alipay Whether it is the mobile phone version.
Recommended learning: php video tutorial
The above is the detailed content of How to determine the browser type on mobile phone (JavaScript). For more information, please follow other related articles on the PHP Chinese website!