I am developing a iOs & Android App with Cordova 1.9 + JQM.
The app reads data from JSON services in "www.example.com", so I have this domain whitelisted in cordova.xml
The problem is I need to open some URL pointing to www.example.com in a new browser window, outside the app.
I tried these:
<a href="#" onclick="navigator.app.loadUrl('http://www.example.com/external')"
class="ui-link" rel="external" target="_blank">external</a>
<a href="#" onclick="window.open('http://www.example.com/externa')"
class="ui-link" rel="external" target="_blank">external</a>
<a href="http://www.example.com/external"
class="ui-link" rel="external" target="_blank">external</a>
...but all of them open the new window inside the webView, not in a native browser new window. I made this work in iOS but can't see the solution for Android.
Any help would be appreciated. thanks!!
There are two ways to do this:
navigator.app.loadUrl("http://www.example.com/index.html", {openExternal: true});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With