Reputation: 67
I just created a Phonegap/Android application but seem to be unable to open any website in any browser. I have tried to open a browser within the app as well as outside of the app - still no luck. Additionally, i have tried just about every snippet that other people have recommended yet still nothing happens when i click the link. Here is what i have tried:
1) I tried adding the following to my config.xml file:
<gap:plugin name="org.apache.cordova.inappbrowser" />
then adding this to my index.html file:
<a onclick="navigator.app.loadUrl('https://google.com/', { openExternal:true });">Link</a>
2) My next attempt was trying:
<a onclick='window.open("http://google.com","_system", "location=yes")' href='javascript:void(0)' >Link</a>
Does anybody know what i am doing wrong?
Upvotes: 2
Views: 651
Reputation: 168
<a onclick='window.open("http://google.com","_system")' href='#'>Link</a>
Upvotes: 0
Reputation: 938
which version of cordova r u using?? if u r using above 3.3.0 then you should use a permission in config.xml file as follows..
<access origin="http://your domain name/*" launch-external="yes" />
Upvotes: 1