Disable telephone number detection on iPad desktop web links?

前端 未结 4 980
别那么骄傲
别那么骄傲 2020-12-16 01:54

I\'m developing a web application that will be launched from a desktop icon on an iPad as a full-screen application. The Apple documentation on phone links recommends using

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-16 02:15

    Put this after tel link load

    if (navigator.userAgent.match(/(iPhone|Android|BlackBerry)/)) {
    //this is the phone
    
    } else if (navigator.userAgent.match(/(iPod|iPad)/)) {
        $('a[href^=tel]').click(function(e){
           e.preventDefault();
        });
    } else {
     //this is the browser
    
        $('a[href^=tel]').click(function(e){
            e.preventDefault();
        });
    }
    

提交回复
热议问题