最近做的一个微信项目中发现iPhone中页面中的长数字被识别成了电话号码,显示成超链接,点击会提示拨打电话。但是这个数字并不是电话号码,而是设备编号,是不合理的。

一开始,我想着这是iPhone设备本身的问题,不是因为我开发做的事情引起的,想着不处理的。但是抱着完美主义的态度,在网上找了一下方案,果然还找到了,在页面中加入如下元信息:

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

官网的说明如下:

How do I disable automatic detection of phone numbers in webpages? In Safari on iPhone, phone numbers are automatically detected and transformed into links that dial the phone number when tapped. If you have strings of numbers in your webpage that should not be automatically detected as phone numbers, you can choose to disable this feature on the entire page by adding the meta tag shown in Listing 12.

参考链接:http://www.cnblogs.com/skylaugh/archive/2013/11/24/3439918.html

发表评论

邮箱地址不会被公开。 必填项已用*标注