使用 javascript、jquery 或 php 获取设备名称和型号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29048494/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting device name and model using javascript, jquery or php
提问by sohag513
I want to create a web page where I can detect the device name and model when visitor view this page from his/her device.
我想创建一个网页,当访问者从他/她的设备查看此页面时,我可以在其中检测设备名称和型号。
回答by Raja Yogan
You could use the ng-fone angular module that I wrote for an app to do this.
您可以使用我为应用程序编写的 ng-fone angular 模块来执行此操作。
More details here: http://tphangout.com/?p=83
更多细节在这里:http: //tphangout.com/?p=83
回答by Apul Gupta
You can use PHP Class which checks for user-agent to find device information.
您可以使用检查用户代理的 PHP 类来查找设备信息。
One of most used class: http://mobiledetect.net/
最常用的类之一:http: //mobiledetect.net/
This question was asked by another user: Simplest way to detect a mobile device
另一个用户问了这个问题:Simplest way to detection a mobile device
回答by Inzamam Tahir
This is not possible in javascript. It does not have the functionality to obtain that much personal information of the user. However, it does have the functionality to tell which browser user is using. These functionalities may be available in a framework like Phonegap but not in core javascript.
这在 javascript 中是不可能的。它没有获取用户那么多个人信息的功能。但是,它确实具有判断用户正在使用哪个浏览器的功能。这些功能可能在 Phonegap 等框架中可用,但在核心 javascript 中不可用。
Please also refer to this page:
另请参阅此页面: