I use this as a general rule:
$('a').live('tap',function(e){
// if external link then open a browser
if(String($(this).attr('href')).substring(0,4)=='http' || String($(this).attr('href')).substring(0,5)=='https'){
navigator.app.loadUrl($(this).attr('href'), { openExternal:true });
e.stopPropagation();
return false;
}
});
Navigator for phonegap works!
handler: function (btn, evt) {
loadURL('http://www.google.com');
}
...
function loadURL(url){
navigator.app.loadUrl(url, { openExternal:true });
return false;
}
Try this for android:
function loadURL(url){
navigator.app.loadUrl(url, { openExternal:true });
return false;
}
Html:
<a click="loadURL('http://twitter.com/foobar')">twitter</a>
You can also try this in your config.xml
:
<access origin="*twitter.com" browserOnly="true"/>