<a target="_blank" data-rel="external" href="http://www.kidzout.com">www.kidzout.com</a>
hey experts i am using phonegap 2.9.0 and i am using the above code to open the link in the browser but it opens it in the same app...... how to open it safari browser?
it opens the website in the same app and then i am unable to come back to the app, so i need to delete the app and install that again.....
If you happen to have jQuery around, you can intercept the click on the link like this:
This way you don't have to modify the links in the html, which can save a lot of time. I have set this up using a delegate, that's why you see it being tied to the document object, with the 'a' tag as the second argument. This way all 'a' tags will be handled, regardless of when they are added.
Ofcourse you still have to install the InAppBrowser plug-in:
As suggested in a similar question, use JavaScript to call
window.open
with thetarget
argument set to_system
, as per the InAppBrowser documentation:This should work, though a better and more flexible solution would be to intercept all links'
click
events, and callwindow.open
with arguments read from the link's attributes.Remember you must install the InAppBrowser plugin for this to work:
Works for me with android & PG 3.0
Will work but only if you have the inappbrowser plugin installed. To install, using terminal, browse to the www folder in your project and type:
or
Then it your link will open in the browser.
I also faced the issue that link was not opening on browser here is my fix with steps:
1: Install this cordova plugin.
2: add the open link in the html like following.
3: this is the most importaint step due to this I faced lots of issue: download the
cordova.js
file and paste it in thewww
folder. Then make a reference of this in theindex.html
file.This solution will work for both the environment android and iPhone.