tel: link causes error "Failed to load webpage with error: The URL can’t be shown"

2,512 views
Skip to first unread message

robl

unread,
Nov 2, 2011, 10:23:23 AM11/2/11
to phon...@googlegroups.com
I am using PhoneGap 1.1.0 on iPhone / iOS 5.0.

I am trying to initiate a phone call with:

           window.open('tel:9995551212','_blank');

but when invoked, it displays this error message:

"Failed to load webpage with error: The URL can’t be shown"

How do I get this to work?????

Lyle Pratt

unread,
Nov 30, 2011, 5:51:40 PM11/30/11
to phonegap
I'm having this same issue on iOS 5.0. Did you ever find a solution?
Wrapping my item in an anchor tag is simply not an option for me. I
need to be able to programmatically initiate the call.

StuVille

unread,
Nov 30, 2011, 6:08:18 PM11/30/11
to phonegap
This is causing me grief as well. :(

Stu

Phonegap

unread,
Dec 2, 2011, 12:29:55 PM12/2/11
to phonegap
any solution yet?

> > > "Failedtoloadwebpagewith error: The URL can’t be shown"

Phonegap

unread,
Dec 2, 2011, 12:36:56 PM12/2/11
to phonegap
same issue here

Todd Blanchard

unread,
Dec 2, 2011, 1:59:58 PM12/2/11
to phon...@googlegroups.com
you could try document.location.href='tel:9995551212';

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

FidoX

unread,
Dec 30, 2011, 12:17:59 PM12/30/11
to phonegap
Using phonegap 1.2 I've tested the

document.location.href='tel:9995551212'; but it doesn't work. Any
other idea?

JC Elu

unread,
Feb 5, 2012, 4:24:19 PM2/5/12
to phonegap
Hi all,

Same problem here :(
No solutions found yet?

Thanks for the help
JC

Shazron

unread,
Feb 6, 2012, 2:27:06 PM2/6/12
to phon...@googlegroups.com
Try this: https://gist.github.com/1725083
pass the function the tel url

Anton

unread,
May 17, 2012, 9:12:42 AM5/17/12
to phon...@googlegroups.com
Hi Shazron,

This solution didn't work for me (though the project is still on v1.1, this could be the problem), so I instead opted to change the href attribute value of the existing link: if the user presses the link, it works fine.

Best regards,
Anton


>> > > For more options, visit this group at
>> > >http://groups.google.com/group/phonegap?hl=en?hl=en
>>
>> > > For more info on PhoneGap or to download the code go towww.phonegap.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to

Anton

unread,
May 17, 2012, 9:14:23 AM5/17/12
to phon...@googlegroups.com
No, this doesn't work, but the project is still on 1.1.0, so that may be the problem. I had to modify the href attribute of an existing link, and when the user presses it it works fine.

Best regards,
Anton

On Monday, 6 February 2012 21:27:06 UTC+2, Shazron Abdullah wrote:


>> > > For more options, visit this group at
>> > >http://groups.google.com/group/phonegap?hl=en?hl=en
>>
>> > > For more info on PhoneGap or to download the code go towww.phonegap.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to

Nate Hamilton

unread,
May 23, 2012, 4:01:37 PM5/23/12
to phon...@googlegroups.com
I'm having the same problem here. I've noticed that my tel links work fine as long as I don't have FastClick (script that gets rid of 300ms delay) installed. I don't want to get rid of fastclick so I tried a javascript work around for the tel links but everything I've tried doesn't work. Any new thoughts on this issue?

Matthew Field

unread,
May 26, 2012, 4:18:54 PM5/26/12
to phon...@googlegroups.com

> How do I get this to work?????


add this function

function callNumber(number)
{
var anchor = document.createElement('a');
anchor.setAttribute('href', 'tel:'+number);
anchor.setAttribute('target', '_self');

var dispatch = document.createEvent('HTMLEvents')
dispatch.initEvent('click', true, true);

anchor.dispatchEvent(dispatch);
}

and then call your number with callNumber('9995551212')




Reply all
Reply to author
Forward
0 new messages