从javascript获取(移动)设备名称 [英] Getting (mobile) device name from javascript

查看:918
本文介绍了从javascript获取(移动)设备名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用javascript获取移动设备的名称(例如John的iPhone)?

Is there a way to get the name of a mobile device (e.g. "John's iPhone" ) using javascript?

也许我不是很清楚......我的意思不是它是iPhone,iPad等,而是设备名称 - 例如它可以是John的iPhone。

Maybe I wasn't very clear... what I meant is not whether it's an iPhone, iPad etc. but the "device name" - for example it can be "John's iPhone".

推荐答案

你无法通过javascript为在本机浏览器中运行的网络应用程序执行此操作 - javascript通常无法访问此个人识别数据。

You can't do this through javascript for a web app running in a native browser - javascript generally doesn't have access to this personal identifying data.

一种可能的方法是使用像 PhoneGap 这样可能有API的框架访问设备名称。但是,您只能通过应用商店部署您的网站,因此根据您的使用情况,这可能非常有限。

One possible way is to use a framework like PhoneGap which may have an API to access the device name. But then, you can only deploy your web site via an app store, so this could be very limiting based on your use case.

这篇关于从javascript获取(移动)设备名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆