Html 如何在 tel: URI 中包含扩展名?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9482633/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 22:50:16  来源:igfitidea点击:

How do I include extensions in the tel: URI?

htmlmobileuriphone-numbertel

提问by Jarede

I currently have a webpage serving up phone numbers, some of these phone numbers have extensions so I have written the HTML like this:

我目前有一个提供电话号码的网页,其中一些电话号码有扩展名,所以我编写了这样的 HTML:

<a href="tel:+44-1234-567;ext=88">+44-1234-56788</a> / <a href="tel:+44-1234-567;ext=99">+44-1234-56799</a

When I hit this page in my Android browser and tap one of the phone numbers, it loads up in my phone dialer (UK Samsung Galaxy s2 stock) as:

当我在 Android 浏览器中点击此页面并点击其中一个电话号码时,它会在我的电话拨号器(英国三星 Galaxy s2 股票)中加载为:

+44-1234-567;ext=88

which I don't think is correct. Surely it should omit the ;ext=word.

我认为这是不正确的。当然,它应该省略这个;ext=词。

Have I misread the RFC for implementing tel?

我是否误读了用于实施的 RFC tel

回答by codemonkey613

Seems the proper way to do it is use a comma:

似乎正确的方法是使用逗号:

<a href="tel:441234567,88">+44-1234-567 ext.88</a>

<a href="tel:441234567,88">+44-1234-567 ext.88</a>

Just tested with iPhone and Android OS 2.1. Using ;ext=88converts the extbit into a number that is dialed with the extension (so it dials something like 35888 instead of 88).

刚刚在 iPhone 和 Android OS 2.1 上进行了测试。Using;ext=88ext位转换为使用分机拨打的号码(因此它拨打的是 35888 而不是 88)。

回答by ldrrp

According to the documentation, you can add what you want like so tel:12345678;ext=123

根据文档,您可以添加您想要的内容,例如 tel:12345678;ext=123

See RFC 3966

请参阅RFC 3966

回答by dario_ramos

In all the examples I saw, the value of extis contained in the full number. So try including 88 in the hrefvalue:

在我看到的所有示例中, 的值ext都包含在完整数字中。因此,请尝试在href值中包含 88 :

<a href="tel:+44-1234-56788;ext=88">+44-1234-56788</a>

回答by www.GapstowDesign.com

For those still wondering about this problem: I've found it best to use this format:

对于那些仍然想知道这个问题的人:我发现最好使用这种格式:

<a href="tel:+13235798328;22">

回答by systemaddict

Standards at thenewcodefrom 3 months ago suggest using a microdata pause.

3 个月前的新代码标准建议使用微数据暂停。

<a href="tel:+13235798328p22">

<a href="tel:+13235798328p22">

Related: Different standards persist across different external platforms and may change the processing of URIs. Click to callfeatures on Google Developers docs do not specify

相关:不同的标准在不同的外部平台上持续存在,并且可能会改变 URI 的处理。 Google Developers 文档上的点击通话功能未指定

Example:Office's Skype uses x to represent extension within skype.

示例:Office 的 Skype使用 x 表示Skype 中的扩展名