I'm developing an mobile site and need to invoke a phone call on mobile at the touchend
event. On iPhone and Android the window.open('tel:555', '_top')
is working fine, invoking a phone call.
On iPad, the default behavior is to offer a "Add to contacts" or "Copy" option. When using a link, it's working fine, as in <a href='tel:555'>555</a>
When trying window.open('tel:555', '_top')
on iPad I'm getting:
Cannot Open Page
Safari cannot open the page because the address is invalid.
I've also tried setTimeout('window.location="tel:555";', 500);
from How to trigger click-to-call with javascript (iphone), same problem.
Is there a way to invoke the default behavior with Javascript?