简体   繁体   English

通过 JavaScript 检测用户设备是否使用移动操作系统

[英]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.除了 Viewport-Size (viewportSize.js) 和 Device-Size (getDevicePixelWidth.js) 之外,我还必须知道用户设备是移动操作系统还是桌面操作系统。 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.我必须在带有 android 或其他移动操作系统和 windows 8 或 Linux 桌面操作系统和 android 或 MacOS 和 iOS 等的表之间有所不同。 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?昨天我在谷歌上搜索了很多并阅读了很多陈述,所以我很困惑,因为有人说,我应该使用:( navigator.appVersion 或 navigator.userAgent其他人说这不是好的程序。实践。我需要一个轻量级的可靠解决方案。有没有人知道?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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