How to detect mobile browser using jQuery or in some other SIMPLE way..? [duplicate]

∥☆過路亽.° 提交于 2019-11-29 00:12:48

There are a few scripts on Detect Mobile Browser that redirect mobile visitors on the server side or with JavaScript or jQuery.

You could use the following to get the platform

navigator.platform

And this to get the browser app

navigator.appName

Example:

// Detects if it is an Android device
var android = (navigator.platform.indexOf("android")>=0);
if (android) {
   // Do something
}

Also, there is the Advanced Browser Check jQuery Plugin, though it seems like it might be overkill.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!