问题
Is it possible through javascript to read the number from the iphone. Lets say i have a html page where they have to fill in the gsm number, can javascript read the number from the phone and fill the form with it?
回答1:
From JavaScript, it's not possible. Actually, the iPhone itself might not know it at all, as the phone number is not necessarily stored on your SIM card.
回答2:
It should be noted that if you are writing your own iPhone application, you can use following:
UIWebView class: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html
You can have HTML code in the your application bundle (or just anywhere on the web)
You can execute any Javascript on that HTML using this method: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006950-CH3-SW21
回答3:
There is a Draft from W3C on System Information API into the Device API section. But it is not yet implmented in any browser.
来源:https://stackoverflow.com/questions/2386011/read-gsm-number-from-iphone-through-javascript