Hi I am working ona client website 1234insurance.com and there is a graphic phone image in the header. The javascript uses the callto function. I just basically want the click to call functionality to work on as many phones as possible. How do people generally handle this?
When you click on it from a phone, it says: the web page at callto://310-473-2680 might be temporarily down or it may have moved permanently to a new web address.
<!-- end of .call-to-action -->
<!-- IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/inc /js/html5.js" type="text/javascript"></script>
<![endif]-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> </script>
<script>
function isiPhone(){
var agent = navigator.userAgent;
var isIphone = ((agent.indexOf('iPhone') != -1) || (agent.indexOf('iPod') != -1)) ;
if (isIphone) {
return true;
} else {
return false;
}
}
$(document).ready(function() {
$('a[href*="callto"]').each(function(){
call_href = $(this).attr('href');
if(isiPhone()){
call_href = call_href.replace('callto://','tel:');
$(this).attr('href',call_href);
}
});
});
/*