![](/img/trans.png)
[英]If I don't have a Bluetooth LE device am I just out of luck with trying to write a program?
[英]Don't want telephone link to call out in brwsers just phones
我正在使用,因為我在頁面上還有其他不是電話號碼的號碼,不希望它們被檢測到。 我將數字包裝在一個鏈接中,但我不希望它在瀏覽器中可點擊,只能在設備上點擊。
這實際上很簡單, Apple 的文檔對其進行了非常徹底的描述——
// Disable automatic telephone number detection
<meta name = "format-detection" content = "telephone=no">
// Explicitly mark a number as a telephone number
<p>A phone number: <a href="tel:1-408-555-5555">1-408-555-5555</a></p>
為了防止鏈接在桌面瀏覽器上單擊時執行任何操作,您可以進行一些瀏覽器嗅探...
$('a.someClass').click(function(e) {
if (!navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
e.preventDefault();
}
});
但是,在使用 Skype 等 VOIP 等軟件司空見慣的時代,您為什么要在桌面瀏覽器中削弱此功能? 有關為什么瀏覽器嗅探是個壞主意的精彩討論,請參閱此問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.