Internet Explorer 11 automatically turns phone numbers into clickable links.

Phone number format recognition

Internet Explorer 11 automatically turns phone numbers into clickable links. This feature works when you have an app that can handle phone numbers, such as Skype.
Here's the developer's perspective phone number detection, including the HTML elements that enable this feature by default and how to turn the feature off when necessary.
Understanding phone number detection
When Internet Explorer in the new Windows UI encounters a telephone number as part of content rendered using a supported HTML element, it turns the number into a clickable link (and does so without modifying the DOM). When the user clicks the link, the app registered to the "tel" URI protocol is invoked.

Note Phone number format recognition is not supported for Internet Explorer for the desktop, for applications hosting the WebBrowser control, or for IE11 for Windows 7.

Phone number detection comes into play for the following content patterns:

<element>425-882-8080</element>

425.<element>882</element>.8080

(425) 882-8080

For more examples and details, see How phone number detection works.Phone numbers are also recognized across entities that span inline elements. This means the display property must be set to "inline".
In the patterns shown earlier, "<element>" refers to one of the following HTML elements:

image.png

Certain exceptions apply, however. Phone number format recognition is disabled when the contentEditable attribute set to "true". It can be also disabled though group policy or user preferences.
Controlling phone number detection
There are a few different ways to control phone number format recognition:

To enable the behavior for an element (and its child elements), set the x-ms-format-detection attribute to "phone" or "all".

To disable the behavior for an element (and its child elements), set the x-ms-format-detection attribute to "none".

To disable the behavior for a webpage, use the meta element:
JavaScript

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

To selectively control the behavior using JavaScript, use setAttribute to change the value of the x-ms-format-detection attribute of the associate element or its parent. (Note that this needs to be done before the element or the parent is rendered in the DOM; dynamic changes are not supported.)

Remember, there is no guarantee that phone number detection will be enabled for IE11. Users can turn the feature off using preferences and administrators can disable the feature using group policies. Plan accordingly.

改文章摘至:https://msdn.microsoft.com/en-us/library/dn265018(v=vs.85).aspx

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末蔫仙,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子摧阅,更是在濱河造成了極大的恐慌外莲,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,185評論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件迫像,死亡現(xiàn)場離奇詭異谢鹊,居然都是意外死亡形耗,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,652評論 3 393
  • 文/潘曉璐 我一進店門碍沐,熙熙樓的掌柜王于貴愁眉苦臉地迎上來狸捅,“玉大人,你說我怎么就攤上這事累提〕竞龋” “怎么了?”我有些...
    開封第一講書人閱讀 163,524評論 0 353
  • 文/不壞的土叔 我叫張陵斋陪,是天一觀的道長朽褪。 經(jīng)常有香客問我置吓,道長,這世上最難降的妖魔是什么缔赠? 我笑而不...
    開封第一講書人閱讀 58,339評論 1 293
  • 正文 為了忘掉前任衍锚,我火速辦了婚禮,結果婚禮上嗤堰,老公的妹妹穿的比我還像新娘戴质。我一直安慰自己,他們只是感情好梁棠,可當我...
    茶點故事閱讀 67,387評論 6 391
  • 文/花漫 我一把揭開白布置森。 她就那樣靜靜地躺著,像睡著了一般符糊。 火紅的嫁衣襯著肌膚如雪凫海。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,287評論 1 301
  • 那天男娄,我揣著相機與錄音行贪,去河邊找鬼。 笑死模闲,一個胖子當著我的面吹牛建瘫,可吹牛的內容都是我干的。 我是一名探鬼主播尸折,決...
    沈念sama閱讀 40,130評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼啰脚,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了实夹?” 一聲冷哼從身側響起橄浓,我...
    開封第一講書人閱讀 38,985評論 0 275
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎亮航,沒想到半個月后荸实,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,420評論 1 313
  • 正文 獨居荒郊野嶺守林人離奇死亡缴淋,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 37,617評論 3 334
  • 正文 我和宋清朗相戀三年准给,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片重抖。...
    茶點故事閱讀 39,779評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡露氮,死狀恐怖,靈堂內的尸體忽然破棺而出钟沛,到底是詐尸還是另有隱情畔规,我是刑警寧澤,帶...
    沈念sama閱讀 35,477評論 5 345
  • 正文 年R本政府宣布讹剔,位于F島的核電站油讯,受9級特大地震影響,放射性物質發(fā)生泄漏延欠。R本人自食惡果不足惜陌兑,卻給世界環(huán)境...
    茶點故事閱讀 41,088評論 3 328
  • 文/蒙蒙 一所禀、第九天 我趴在偏房一處隱蔽的房頂上張望奢驯。 院中可真熱鬧,春花似錦只泼、人聲如沸狞玛。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,716評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽心肪。三九已至锭亏,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間硬鞍,已是汗流浹背慧瘤。 一陣腳步聲響...
    開封第一講書人閱讀 32,857評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留固该,地道東北人锅减。 一個月前我還...
    沈念sama閱讀 47,876評論 2 370
  • 正文 我出身青樓,卻偏偏與公主長得像伐坏,于是被迫代替她去往敵國和親怔匣。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 44,700評論 2 354

推薦閱讀更多精彩內容