Html href="tel:" 和手机号码

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

href="tel:" and mobile numbers

htmlhreftel

提问by Sebastian Starke

If I use tel:I should write the international phone code, like that.

如果我使用tel:我应该写国际电话代码,就像那样。

<a href="tel:+6494461709">61709</a>

So far, so good, but I can't find information on how to write a cell phone number in an "international" way, if there is one.

到目前为止,一切都很好,但是我找不到有关如何以“国际”方式编写手机号码的信息(如果有的话)。

回答by

When dialing a number within the country you are in, you still need to dial the national trunk numberbefore the rest of the number. For example, in Australia one would dial:

在您所在国家/地区拨打号码时,您仍然需要先拨打国家中继号码,然后再拨打其余号码。例如,在澳大利亚,您可以拨打:

   0 - trunk prefix
   2 - Area code for New South Wales
6555 - STD code for a specific telephone exchange
1234 - Telephone Exchange specific extension.

For a mobile phone this becomes

对于手机,这变成了

   0 -      trunk prefix
   4 -      Area code for a mobile telephone
1234 5678 - Mobile telephone number

Now, when I want to dial via the international trunk, you need to drop the trunk prefix and replace it with the international dialing prefix

现在,当我想通过国际中继拨号时,您需要删除中继前缀并替换为国际拨号前缀

   + -      Short hand for the country trunk number
  61 -      Country code for Australia
   4 -      Area code for a mobile telephone
1234 5678 - Mobile telephone number

This is why you often find that the first digit of a telephone number is dropped when dialling internationally, even when using international prefixing to dial within the same country.

这就是为什么您经常发现在拨打国际电话时电话号码的第一位数字丢失的原因,即使在使用国际前缀在同一国家/地区拨打时也是如此。

So as per the trunk prefix for Germanydrop the 0and add the +49for Germany's international calling code(for example) giving:

因此,作为每长途字冠为德国下降了0,并添加+49德国的国际电话代码(例如),并提供:

<a href="tel:+496170961709" class="Blondie">
    Call me, call me any, anytime
      <b>Call me (call me) I'll arrive</b>
        When you're ready we can share the wine!
</a>

回答by vineet

I know the OP is asking about international country codes but for North America, you could use the following:

我知道 OP 正在询问国际国家/地区代码,但对于北美,您可以使用以下内容:

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

<a href="tel:18475555555">Click Here To Call Support 1-847-555-5555</a>

This might help you.

这可能对你有帮助。

回答by Rafff

The BlackBerry browser and Safari for iOS (iPhone/iPod/iPad) automatically detect phone numbers and email addresses and convert them to links. If you don't want this feature, you should use the following meta tags.

适用于 iOS (iPhone/iPod/iPad) 的 BlackBerry 浏览器和 Safari 会自动检测电话号码和电子邮件地址并将其转换为链接。如果您不想要此功能,则应使用以下元标记。

For Safari:

对于 Safari:

<meta name="format-detection" content="telephone=no">

For BlackBerry:

对于黑莓:

<meta http-equiv="x-rim-auto-match" content="none">

Source: mobilexweb.com

资料来源:mobilexweb.com

回答by Tropicalrambler

As an additional note, you may also add markup language for pausing or waiting, I learned this from the iPhone iOS which allows numbers to be stored with extension numbers in the same line. A semi-colon establishes a wait, which will show as a next step upon calling the number. This helps to simplify the workflow of calling numbers with extensions in their board. You press the button shown on the bottom left of the iPhone screen when prompted, and the iPhone will dial it automatically.

作为附加说明,您还可以添加用于暂停或等待的标记语言,我从 iPhone iOS 中了解到这一点,它允许将号码与分机号码存储在同一行中。分号建立一个wait,它将在呼叫号码时显示为下一步。这有助于简化在其板上使用分机呼叫号码的工作流程。当出现提示时,您按下 iPhone 屏幕左下方显示的按钮,iPhone 将自动拨打它。

<a href="tel:+50225079227;1">Call Now</a>

The pauseis entered with a comma ",", allowing a short pause of time for each comma. Once the time has passed, the number after the comma will be dialed automatically

暂停输入用逗号“”允许的时间每个逗号短暂的停顿。一旦时间过去,逗号后的号码将自动拨打

<a href="tel:+50225079227,1">Call Now, you will be automaticlaly transferred</a>

回答by Chalky

It's the same. Your international format is already correct, and is recommended for use in all cases, where possible.

一样的。您的国际格式已经正确,建议尽可能在所有情况下使用。