使用 HTML5/jQuery 从 iPhone 获取用户编号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2738243/
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
Get users number from iPhone using HTML5/jQuery
提问by Phill Pafford
Is there a method for getting the iPhone users phone number using HTML5/jQuery?
是否有使用 HTML5/jQuery 获取 iPhone 用户电话号码的方法?
All I see is how to do this with the SDK.
我所看到的只是如何使用 SDK 做到这一点。
EDIT:
编辑:
So far the only thing I've found is on the initial install ask the user for their number and store it.
到目前为止,我发现的唯一一件事是在初始安装时询问用户他们的号码并存储它。
回答by meo
I am pretty sure, that this is not possible. Imagine the security/privacy breach it would represent if any site could just retrieve the phone number of each visitor.
我很确定,这是不可能的。想象一下,如果任何站点都可以检索每个访问者的电话号码,它将代表安全/隐私泄露。
If you are developing a HTML5 & JS app with PhoneGap for example you can, using the according API: http://docs.phonegap.com/en/1.0.0/phonegap_contacts_contacts.md.html
例如,如果您正在使用 PhoneGap 开发 HTML5 和 JS 应用程序,则可以使用相应的 API:http: //docs.phonegap.com/en/1.0.0/phonegap_contacts_contacts.md.html
回答by Cbe317
There is a Draft from W3C on Device API. This API will provide access (submitted to user permission) to Tasks, Contacts, Calendar, Camera, Microphone, Messaging Service, Communication Log, System Information (device information, battery level, network status, ...),... But it is not yet implmented in any browser.
W3C 有一个关于Device API的草案。此 API 将提供对任务、联系人、日历、相机、麦克风、消息服务、通信日志、系统信息(设备信息、电池电量、网络状态等)的访问(提交给用户许可)……但它尚未在任何浏览器中实现。
Because of a big expectation, these APIs will probably be implemented very quickly in WebKit (base of iPhone and Android browsers). Mozilla is working on a draft implementation of Contact API with the Contact AddOn
由于期望很高,这些 API 可能会很快在 WebKit(iPhone 和 Android 浏览器的基础)中实现。Mozilla 正在使用Contact AddOn制定 Contact API 的实现草案
回答by Jeena
You could just ask the user:
你可以问问用户:
var phone_number = prompt("Please enter your phone number:");