php - Click-to-call on BlackBerry -
i have site displays telephone numbers , email addresses. aim enable user click on tel or email complete action.
currently have .php file creates uri tell or email , track actions. have following in html link user see:
<a href="track.php?" target="_self">contact</a>
track.php determines if call / email / website , sets $location var (either tel:1231231234 / web:www.test.com / mailto:address@test.com). if tried returning / doing redirect in following ways:
1.
echo '<script type="text/javascript"> window.location="'.$location.'"; </script>';
2.
header('location: ' . $location);
3.
echo '<script type="text/javascript"> header.location="'.$location.'"; </script>';
all of these methods work on iphone / android / symbian devices, not on blackberry (i've tested bb curve 8520).
if hardcode links (see code below) , click on directly works 100%, redirect gives me "protocall not supported..." error.
<a href="tel:xxxxxxxxx">phone xxxxxxxxxx</a> <a href="mailto:xxx@xxx">mail xxxxxx@xxxxxxx.co.za</a> <a href="web:xxxx">open link www.xxxxxxx.co.za</a> <a href="sms:xxxxx">send sms xxxxxxx</a>
any suggestions / solutions / workaround?
ps. did try , without <meta http-equiv="x-rim-auto-match" content="none" />
meta tag. still gives same error.
unfortunately don't have blackberry test with, here can try:
use synchronous xmlhttprequest call (i.e. ajax without "asynchronous" part) call tracker. in case, track.php doesn't need redirect @ all, because called in background.
<script type="text/javascript"> function callurl(url) { // i'll assume don't have ie on blackberry, , can use native xmlhttprequest object var xhr = new xmlhttprequest(); xhr.open('get', url, false); xhr.send(); </script> <a href="tel:xxxxxxxxx" onclick="callurl('track.php');">phone xxxxxxxxxx </a>
Comments
Post a Comment