Windows phone 7/8将map:links和tel:links注入页面DOM.这些注入的链接也改变了DOM:它将原始HTML文档中的空格转换为 和换行到<br>标签,然后将它们包装在锚点中.在检测地址时,浏览器似乎也有误报,它将无序列表中的元素转换为map:link.
我想完全禁用此功能(如果可能的话).
<!doctype html>
<html>
<head>
<!--<meta name="format-detection" content="none"/>-->
<!--<meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">-->
<!--<script type="text/javascript">-->
<!--document.execCommand('AutoUrlDetect', false, false);-->
<!--</script>-->
</head>
<body>
<div>
<p>
9380 W. Glendale Ave.<br />
Glendale, AZ 85305-9400
</p>
<!--<p x-ms-format-detection="none">-->
<p>
623-872-6700
</p>
</div>
<ul>
<li>Quicker Checkout</li>
<li>Order History/Track Your Order</li>
<li>Create an Address Book</li>
<li>Manage CLUB/Credit Cards</li>
<li>Create a Wish List</li>
<li>Write Customer Product Reviews</li>
<li>Access Your Account Anywhere</li>
</ul>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
此代码将生成以下输出: 输出图像
该页面添加了以下链接:
<a href="maps:9380%20W.%20Glendale%20Ave.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Glendale,%20AZ%2085305-9400">9380 W. Glendale Ave.<br> <br>Glendale, AZ 85305-9400</a>
<a …Run Code Online (Sandbox Code Playgroud) javascript ie-mobile windows-mobile windows-phone windows-phone-8