Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
415 views
in Technique[技术] by (71.8m points)

html - 单击手机网页中的链接时如何触发电话(How to trigger a phone call when clicking a link in a web page on mobile phone)

I need to build a web page for mobile devices.

(我需要为移动设备构建一个网页。)

There's only one thing I still haven't figured out: how can I trigger a phone call through the click of text?

(只有一件事我还没弄明白:如何通过点击文字来触发电话?)

Is there a special URL I could enter like the mailto: tag for emails?

(是否有一个特殊的URL我可以输入,如mailto:标签的电子邮件?)

Device specific solution are not preferred.

(设备特定解决方案不是优选的。)

I know iPhone automatically recognizes phone numbers and creates a link for this, but it would be great if this could be done for images too... and also for most mobile devices.

(我知道iPhone会自动识别电话号码并为此创建一个链接,但如果可以对图像进行此操作也会很棒......对大多数移动设备也是如此。)

  ask by Frederic Morin translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Most modern devices support the tel: scheme.

(大多数现代设备都支持tel:scheme。)

So use <a href="tel:555-555-5555">555-555-5555</a> and you should be good to go.

(所以使用<a href="tel:555-555-5555">555-555-5555</a> ,你应该很高兴。)

If you want to use it for an image, the <a> tag can handle the <img/> placed in it just like other normal situations with : <a href="tel:555-555-5555"><img src="path/to/phone/icon.jpg" /></a>

(如果你想将它用于图像, <a>标签可以处理放置在其中的<img/> ,就像其他正常情况一样: <a href="tel:555-555-5555"><img src="path/to/phone/icon.jpg" /></a>)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...