Skip to content

jquery-phonelink is a plugin to correct tel: links on mobile devices and to disbale tel: links on non mobile devices

Notifications You must be signed in to change notification settings

cmichael-de/jquery-phonelink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

jquery-phonelink

Jquery-phonelink is a plugin that corrects "tel:" links on mobile devices and disbales "tel:" links on non mobile devices.

How it works

Jquery-phonelink is looking for phonelinks like: <a href="tel:111111>111111</a>. If your page does not contain any phonelink then jquery-phonelink does nothing. On the other way it checks if the user device is a mobile or a non mobile device. On non mobile devices phonlinks are rewritten to html span-tags for example: <a href="tel:111111>111111</a> will be rewritten to <span>111111</span> (in this case the link text is used not the href url). On a mobile device jquery-phonelink takes the href url and checks if the telephone number has the correct Format. If not it goes to fix it:

  1. Remove all non digits characters: 0391 22 23 / 1 -> 039122231
  2. Add country code: 039122231 -> +4939122231

TAKE CARE - BE AWARE! If your phonenumbers do not contain country codes, jquery-phonelink adds the default country code 49 which is german.

How to use

Just include the jquery-phonelink.min.js before closing </body> to your website. Just add the html5 phonelink markup to your numbers.

About

jquery-phonelink is a plugin to correct tel: links on mobile devices and to disbale tel: links on non mobile devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published