Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery html() on iPad

Tags:

jquery

ipad

var partnerId = $('.partnerId').html();

The code above pulls the inner html from

<span id="_ctl0_ContentPlaceHolder1_lPartnerID" class="partnerId">1122</span></td>

correctly on IE7 and firefox. The code fails on iPad.

alert(partnerId) returns "1122" correctly on FireFox and IE7. But, on iPad I get

<a href="tel:1122">1122</a> as my return value.

How can I fix this?

like image 550
P.Brian.Mackey Avatar asked May 29 '26 05:05

P.Brian.Mackey


1 Answers

Just a moment before I posted, I figured out how to fix the problem. Someone else may benefit from this solution so I posted anyhow. The issue is due to iPads telephone number detection. iPad wraps what it believes to be a telephone# in some HTML (what you see above). In my case, I do not need or want phone number detection. So I stuck

<meta name = "format-detection" content = "telephone=no" />

in the master page header. Problem solved.

like image 193
P.Brian.Mackey Avatar answered Jun 01 '26 05:06

P.Brian.Mackey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!