-1

I'm trying to build an anchor tag that uses one of those tel://xxxxxxxxxxx links to dial a number. But these links don't work on a non-phone computer.

Is there a way I can detect a phone so that I can dial the number on phones but copy the number to the clipboard on non-phone??

I want to support all phones possible so I don't want to do navigator sniffing..

Naman Goel
  • 1,525
  • 11
  • 16
  • You could put it in an if statement with actions based on http://stackoverflow.com/questions/1005153/auto-detect-mobile-browser-via-user-agent –  Nov 17 '12 at 10:30

2 Answers2

1

More of a suggestion than a technical solution, but maybe you could add a second link for copying the phone number to the clipboard. This way it's much more clearer to your end user what action is going on.

Note that non-phone computers can have dialing functionality too. My work laptop has Lync integrated in its browser, so when I click a tel: href it starts dialing. Going with the default behavior of the end user's browser will give the best user experience imo.

Stijn De Vos
  • 312
  • 3
  • 8
1

The tel link is not really necessary on modern systems as telephone numbers are recognized automatically if there are any programs installed that can dial them

Jörn Berkefeld
  • 2,540
  • 20
  • 31