Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using javascript/jquery to dial a number

Does anyone know how I can dial a number using javascript? I've tried the following:

window.location.href = 'tel:7178081998';

The button registers a click but doesn't do anything in the ios environment.

I'm running into an issue where my "tel" links do not work because of a script that I have (FastClick). I've tried everything I can think of which is why I am at where I am.

Thoughts?

like image 718
nate8684 Avatar asked Nov 14 '22 05:11

nate8684


1 Answers

<a href="tel:5558675309">555-867-5309</a> This should work.

If need put a pop up dialog to ask user " Are you sure you want to call" Just in case s/he clicked it unintentionally.

<a id="call" href="">555-867-5309</a>

Use call id to open a dialog, on click of ok, put data dynamically to href attribute.

like image 114
Akki619 Avatar answered Nov 16 '22 02:11

Akki619