I am new to PhoneGap and Android.I am unable to access Extrenal URL\' like google from PhoneGap,i tried Iframe and Window.Location.Href but not sure why it\'s not working.
Have you added the external URLs to the whitelist? There is a file in /res/xml
in your project called PhoneGap.xml
Here is an example of one of my PhoneGap.xml
files:
<?xml version="1.0" encoding="utf-8"?>
<phonegap>
<access origin="http://127.0.0.1*"/>
<access origin="http://devgeeks.org"/>
<access origin="http://*.phonegap.com"/>
<log level="DEBUG"/>
</phonegap>
The access xml helped me. You can use the navigator.app.loadUrl
function to get the url loaded in the current webview - look in the cordova.js
file for details of the options
Opening an external link in phonegap / android is only possible two ways: Source: https://build.phonegap.com/blog/access-tags
check blogpost of phonegap. They're explaining what the android default is, and what you can do about it.
Follow the discussing on the phonegap forum: http://community.phonegap.com/nitobi/topics/make_links_use_external_broswer_consistently
Edit:
Add the following code to your config.xml.
<access origin="http://www.domain.com" browserOnly="true" />
Add:
function loadURL(url){
navigator.app.loadUrl(url, { openExternal:true });
}
Add:
<a onclick="loadURL('http://www.domain.com')" href="#">Url</a>