简体   繁体   中英

Detect via JavaScript if mobile operating system is used by the users device

In addition to the Viewport-Size (viewportSize.js) and the Device-Size (getDevicePixelWidth.js) I have to know if the user device is a mobile or a desktop operating system. For expl. I have to differ between a table with android or other mobile os and windows 8 or Linux desktop os and android or MacOS and iOS and so on. Yesterday I googled a lot and read many statements, so I'm confused, cause some say, I should use: ( navigator.appVersion or navigator.userAgent other say that aint good progr. practice. I need a lightweight reliable solution. Does anyone know?

您可以使用jquery-browser-plugin来检测是移动设备还是桌面设备。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM