开发者

How to format a phone number on a website, so that it can be dialed when clicked on a mobile browser?

I'm creating a website, and on the contact page there is an international phone 开发者_如何学运维number like :

+ xx (x) x xx xx xx xx

Is there a way to format it so that it can be clicked by someone browsing the site on a mobile phone. I can only test with Android on an HTC Desire, and he grabs some of the numbers but not the whole string.


While it is not a standard, you can try something similar to the following:

<a href="tel:1-408-555-5555">1-408-555-5555</a>

This works for iOS based devices, however, and may not be supported by other devices. http://beradrian.wordpress.com/2010/01/15/special-links/ discusses some other link formats which may be available in other devices, e.g. wtai://... callto://...

The downside to this approach is that you will have to test on multiple devices and potentially have to detect which device is accessing the page and display a different link/value depending on the specific client.


I'm guessing that it would vary greatly depending on the OS of the mobile in question. Basic answer - possible, but you would have to cater for every phone OS out there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜