Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to tell if an end user will be able to handle <a href="tel:###"> links?

So if you want to link to a phone number you would do something like

<a href="tel:18005555555">Click to Call</a>

This is used commonly on mobile websites and is gaining traction on desktop sites as well (largely thanks to Skype I think.) However some computers/devices aren't able to support it. Is there a way to tell if a user is able to handle tel: links?

Solution can be either server side or client side but I would imagine it would need to be client side.

like image 567
Andrew G. Johnson Avatar asked Jun 22 '13 14:06

Andrew G. Johnson


People also ask

How do Tel links work?

Adding an HTML Phone Number Call Link to your WebsiteHref=tel: creates the call link. This tells the browser how to use the number. “Tel: 123-456-7890 “creates the HTML phone number. The number within the quotes is the number it will call.

Can you hyperlink a phone number?

Follow these steps: Highlight the phone number that you want to be clickable. Right-click the phone number. Choose Hyperlink.

How do you code a phone number in HTML?

Start your code with <a href=“”></a> Make a note of where the quotation marks are, because you'll now enter your business phone number between the quotes. Make sure to enter it without dashes and enter “tel:” before you start typing your number. For example: <a href= “tel:+YOURNUMBERHERE”


1 Answers

DeviceAtlas and Wurfl can get you some of this information, but as many have pointed out, there’s really no truly reliable way to detect a device’s ability to make a call. After all, someone might be on desktop, but capable of making a call from it based on the software they have installed (or even their OS capabilities).

In the interest of providing the best experience, you should include tel: links. That will give everyone the opportunity to dial the number if they can handle it. You could use CSS to make it look less link-like to reduce potential confusion for non tel: supporting browsers/OSes. Users who want to call the number will select it or touch it anyway (in hopes of copying the number) and will either activate the link (in touch scenarios) or see the hand (in mousing scenarios), helping them more quickly achieve their goal.

As a bit of an aside, setting white-space: nowrap on tel: links is always a good idea too :-) That will keep numbers on a single line so the hyphens don’t allow it to break.

a[href^=tel:] { white-space: nowrap; }
like image 132
Aaron Gustafson Avatar answered Sep 21 '22 21:09

Aaron Gustafson