I try to open external url like this,
<a href="http://google.com" target="_system" >
and also try with _blank
but it's open in same app screen not open in safari browser,
How to resolve..?
If you change your links to use the new InAppBrowser syntax, then it's easy to open your URLs either in the system web browser, the InAppBrowser or the actual webview of your app.
This code should open your URL in the system web browser (Safari on iOS):
<a href="#" onclick="var ref = window.open('http://google.com', '_system');">
Changing '_system'
to '_blank'
will open the URL in the InAppBrowser.
Changing '_system'
to '_self'
will open the URL in the webview of your app (if the domain is whitelisted) or the InAppBrowser (if the domain is not whitelisted).
Sample Gist: https://gist.github.com/wicketyjarjar/7043336
Note: Cordova/PhoneGap 3.0+ require the InAppBrowser plugin to be installed before this will work.
To install the InAppBrowser plugin (if necessary)...
Using Cordova: cordova plugin add org.apache.cordova.inappbrowser
Using PhoneGap: phonegap local plugin add org.apache.cordova.inappbrowser
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