Initially, my project using Dojo worked flawlessly with PhoneGap 2.7.0. However, upon upgrading to PhoneGap 3.0, none of the ajax requests appear to be going through.
To rule out Dojo as a factor, I created a basic test page using plain JavaScript, but unfortunately encountered the same issue.
Sincerely, Mike
My current setup:
- PhoneGap 3.0
- Android 4.1.1 on Galaxy S3, or Android 4.3 on emulator
- The < uses-permission android:name="android.permission.INTERNET" /> is included in the manifest
- < access origin="*" /> is specified in the config.xml
JavaScript logic:
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange=function(){
alert ("rdystate: " + xmlhttp.readyState);
alert ("status: " + xmlhttp.status);
alert ("Text: " + xmlhttp.statusText);
alert ("ResponseText: " + xmlhttp.responseText);
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
alert(xmlhttp.responseText);
}
}
xmlhttp.open("GET","http://10.0.2.2:8080/myapp/rest/feedback/ping",true);
xmlhttp.send();
Output:
rdystate: 1
rdystate: 2
status: 404
Text: *empty*
ResponseText: *empty*
rdystate: 4
status: 404
Text: *empty*
ResponseText: *empty*