My dojo based project worked fine with phonegap 2.7.0 but after "upgrade" with phonegap 3.0 none of the ajax requests seem to be getting through.
I created a simple test page with plain javascript (to eliminate dojo as a variable) and the results are the same.
Thanks Mike
My environment
javascript:
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*
I'm not 100% sure about this but I believe that using IP addresses may not fall under the domain whitelist? Can you point a DNS record to it and try using the domain name instead?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.