954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

iPhone telephone numbers active link to call

iPhone and more can automatically recognize phone numbers and make them an active link to click and initiate a call to that number.

I can do this on many webpages, but not in myTinyTodo task list. Anyone know what might be preventing the phones from being able to recognize the number and make it active?

You can input a task on this page with a phone number and then view on your phone to see if it is active link or not.

Thanks!

http://www.mytinytodo.net/demo/?pda

SolidSolutions
Junior Poster
136 posts since Jul 2010
Reputation Points: 24
Solved Threads: 24
 

I've done some testing. It appears that data returned from an AJAX call does not get "processed" or "processed as expected" and thus does not automatically get linked as a phone number. However, passing the phone number through AJAX as a phone link does work.

For example, just passing 555-678-1234 does not get the active phone linking. However, passing:

<a href="tel:555-678-1234">555-678-1234</a>

does provide the active phone linking.

Now the only problem for me is that myTinyTodo does not allow the inclusion of HTML as code. It just sees it as text. But, now that I know what is going on, I can try to incorporate a "hack".

SolidSolutions
Junior Poster
136 posts since Jul 2010
Reputation Points: 24
Solved Threads: 24
 

To hopefully help someone else looking for this situation with an iPhone not displaying phone numbers as active links:

The problem for us was the iPhone would not automatically convert phone numbers to active links for clicking to initiate a phone call when the phone number displayed was AJAX generated content.

So, we implemented jquery to find phone numbers and add the tel link to the phone numbers so the iPhone would recognize that:

$('.task-title').each(function() {
   $(this).html( $(this).html().replace(/(\d\d\d-\d\d\d-\d\d\d\d)/g,'<a href="tel:$1">$1</a>') );
});

of course, you can change format for your type of phone number data.

SolidSolutions
Junior Poster
136 posts since Jul 2010
Reputation Points: 24
Solved Threads: 24
 

Solid,

I've been following this but with nothing to offer. Now I know the solution, I understand the problem!

My twopenny worth (after the hard work is done) .... it would be slightly(?) more economical to make $(this) just once inside the each loop:

$('.task-title').each(function() {
   var $this = $(this);
   $this.html( $this.html().replace(/(\d\d\d-\d\d\d-\d\d\d\d)/g,'<a href="tel:$1">$1</a>') );
});


Airshow

Airshow
WiFi Lounge Lizard
Moderator
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: