Detecting HTML <a> click-to-call support in JavaScript

JavascriptWeb DevelopmentFront End Scripts

The tel: protocol is supported by almost every mobile device nowadays. This includes Safari on iOS, Android Browser, Symbian browser, Opera Mini, etc.

Add it like this −

if (/(HTC825)/i.test(navigator.userAgent)){
   $("a[href^='tel:']").each(function(){
      this.href = this.href.replace("tel:", "wtai://wp/mc;");
   });
}
raja
Published on 06-Apr-2018 08:04:12
Advertisements