gpt4 book ai didi

HTML 电话 : link to emergency number

转载 作者:行者123 更新时间:2023-12-03 09:42:51 26 4
gpt4 key购买 nike

如何创建 HTML <a href="tel:"></a>链接到紧急号码,如 911112 ?

RFC says

The phone number can be represented in either global or local notation. All phone numbers MUST use the global form unless they cannot be represented as such. [Emergency numbers ("911", "112")] cannot be represented in global form and need to be represented as a local number with a context.



来自 local-context section我觉得理解什么是“本地上下文”并不容易,更不用说这种情况下正确的上下文了。它列出了域前缀,如 houston.example.com或数字前缀,如 +1 ,并且在一段中说

A context consisting of the initial digits of a global number does not imply that adding these to the local number will generate a valid E.164 number. It might do so by coincidence, but this cannot be relied upon. (For example, "911" should be labeled with the context "+1", but "+1-911" is not a valid E.164 number.)



但是这一段的措辞再次令人困惑。


<a href="tel:+49-112">112</a>

现在这样做的正确方法,以及它不是有效的 E.164 号码这一事实无关紧要?

或者它不是有效的 E.164 号码是一个问题?

In some other places我看到人们使用
<a href="tel:112;phone-context=emergency.example.com">112</a>

再次 other people recommend
<a href="tel:112;phone-context=+49">112</a>

但是当我在 Android 上点击该链接时,拨号器会打开该号码
112;746632668398+49

最佳答案

引用 Section 5.1.5 RFC 状态

A context consisting of the initial digits of a global number does not imply that adding these to the local number will generate a valid E.164 number. It might do so by coincidence, but this cannot be relied upon. (For example, "911" should be labeled with the context "+1", but "+1-911" is not a valid E.164 number.)



我的解释是,紧急号码应该以国家特定的前缀为前缀,即
  • 在美国,911应该用作 <a href="tel:+1-911">911</a>
  • 在德国 112应该用作 <a href="tel:+49-112">112</a>

  • 本段的其余部分是关于此语法不符合 E.164 建议。据我所知,E.164 在这种情况下是无关紧要的。

    关于HTML 电话 : link to emergency number,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49095584/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com