html5 微网页 点餐_使用HTML5和微数据向网页添加电话号码

html5 微网页 点餐

Traditionally, phone numbers have been placed on web pages as a simple string of digits, indistinguishable from any other content. When mobile users visit sites, they have an expectation that phone numbers should be useful, leading to direct contact.

传统上,电话号码以简单的数字字符串形式放置在网页上,与任何其他内容都没有区别。 当移动用户访问网站时,他们期望电话号码会有用,从而可以直接联系。

We achieve that with two approaches: adding a link with a tel protocol, and inserting microdata. There are also a few considerations we must make for desktop applications, most particularly Skype and Internet Explorer.

我们通过两种方法来实现:添加带有tel协议的链接,以及插入微数据 。 对于桌面应用程序,还必须考虑一些注意事项,尤其是Skype和Internet Explorer 。

链接移动设备和电话应用程序的电话号码 (Linking Phone Numbers For Mobile Devices and Telephony Applications)

Much like adding a mailto: link around eMail addresses on a page, phone numbers are linked with a tel protocol:

就像在页面上的电子邮件地址周围添加mailto:链接一样,电话号码与tel协议链接:

To make a booking, call 317-456-2564

iPhones, Androids and other mobile devices will now recognize the phone number; engaging the link will initiate a phone call.

iPhone,Android和其他移动设备现在可以识别电话号码; 使用该链接将启动一个电话。

There are a few things to be aware of:

有几件事要注意:

  • Remember that all web pages are international; the digits listed after tel should include the international dialing prefix, making the number useable from any location.

    请记住,所有网页都是国际性的; tel后面列出的数字应包含国际拨号前缀,从而使该号码可在任何位置使用。

  • If the page is viewed in a desktop browser, clicking on the number will bring up an associated telephony application, such as Skype, Google Voice or Microsoft Communicator, much as using a mailto: protocol in a link will bring up an eMail application.

    如果在桌面浏览器中查看该页面,则单击该号码将打开一个关联的电话应用程序,例如Skype,Google Voice或Microsoft Communicator,就像在链接中使用mailto:协议将打开一个电子邮件应用程序一样。

  • Visual separators are optional in the specification, with the exception of the + symbol before the international calling code.

    视觉分隔符在规范中是可选的,但国际调用代码之前的+符号除外。

Do not confuse the tel value with how the number is dialed on a phone: most phone systems will require a 00 before an international code when dialing, but this is not included in the tel value. For example, to specify a phone number in New Zealand:

不要将tel值与电话上的号码号码方式混淆:大多数电话系统在拨号时都需要在国际代码前加上00 ,但这并不包含在tel值中。 例如,要指定新西兰的电话号码:

Call 445-2663 in Auckland to reserve your flight.

It is possible to insert pauses in the phone number, for the purposes of adding an extension:

为了添加分机号,可以在电话号码中插入暂停符:

Call customer service at 323-579-8328 ext. 22

(p defines a one-second pause; w means "wait for dial tone")

( p定义一秒钟的暂停; w表示“等待拨号音”)

You can also specify fax numbers in exactly the same way by using the fax: protocol.

您也可以通过使用fax:协议以完全相同的方式指定传真号码。

添加微数据 (Adding Microdata)

You may want to enrich your markup by adding microdata, enabling search engines to better understand the fact that the digits on the page are, in fact, a phone number:

您可能希望通过添加微数据来丰富您的标记,使搜索引擎可以更好地了解页面上的数字实际上是电话号码这一事实:

Beach Bunny Swimwear

Phone: 850-648-4200

翻译自: https://thenewcode.com/536/Adding-Phone-Numbers-To-Web-Pages-With-HTML5-and-Microdata

html5 微网页 点餐

你可能感兴趣的:(python,java,http,linux,javascript)