0

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?

Community
  • 1
  • 1
Caio Cunha
  • 23,326
  • 6
  • 78
  • 74
  • This might help you - it did me http://stackoverflow.com/questions/7930001/force-link-to-open-in-mobile-safari-from-a-web-app-with-javascript – Mitch Ward Jun 06 '12 at 16:19

1 Answers1

1

I believe this is the correct behaviour.

In the Apple URL Scheme Reference they specifically say that...

If the Phone application is not installed on the device, opening a tel URL displays an appropriate warning message to the user.

I would assume that an iPod Touch would also produce a similar error.