[
https://issues.apache.org/jira/browse/CB-9040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14550646#comment-14550646
]
Eason Shen commented on CB-9040:
--------------------------------
In addtion, I've set <access origin="*"/> in config.xml.
> it is not able to send any XMLHttpRequest in Android device
> -----------------------------------------------------------
>
> Key: CB-9040
> URL: https://issues.apache.org/jira/browse/CB-9040
> Project: Apache Cordova
> Issue Type: Bug
> Affects Versions: 5.0.0
> Environment: Android 4.1/4.3
> Reporter: Eason Shen
> Labels: ajax, xmlhttprequest
>
> I've ran app by 'cordova run android' and it runs in my Android device, and
> it is not able to send any XMLHttpRequest to the remote server, but it works
> in Chrome(server response CORS:*).
> I use angular $http at first, and then zepto.ajax, at last I tried original
> XMLHttpRequest object.
> The request returns immediately with no actual request sent to the server,
> the server never receives any request and I've also do the capture work (via
> fildder), no packet passed through it.
> Also there is no status code (maybe 0), but I can't confirm if there is any
> js error.
> I've tried 3 devices, and neither of them passed.
> Testing code below:
> var request = new XMLHttpRequest();
> request.open("GET",
> "http://wx.ujietrip.com/service/rest/common/manufactuers/", true);
> request.onreadystatechange = function(){//Call a function when the state
> changes.
> alert("state = " + request.readyState);
> if (request.readyState == 4) {
> alert("*" + request.responseText + "*");
> if (request.status == 200 || request.status == 0) {
> console.log("*" + request.responseText + "*");
> }
> }
> }
> request.send();
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]