Reputation: 14042
I'm using Phonegap + JQuerymobile to develop an Android app.
I wish to open an external link on an external browser (say Firefox, or Chrome; or let the user choose the browser).
How can I achieve this?
I have tried, without achieving desired results:
<a href="https://mylink.com" data-role="button" onclick="window.open('https://mylink.com', '_system'); return false;">mylink.com</a>
I also use '_blank', but I don't really see the difference.
Thanks.
I've done some research, but have not found yet an answwer. I've also checked this questions, but they don't seem to solve my problem:
Upvotes: 1
Views: 2228
Reputation: 14042
This did the job: using navigator.app.loadUrl()
full example:
<a href="#null" data-role="button" onclick="navigator.app.loadUrl('https://mylink.com/', { openExternal:true }); return false;" target="_system"></a>
(taken from: Opening an url in a new browser window in Android working with PhoneGap)
Upvotes: 1