cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eason Shen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-9040) it is not able to send any XMLHttpRequest in Android device
Date Wed, 20 May 2015 04:53:59 GMT

    [ https://issues.apache.org/jira/browse/CB-9040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14551809#comment-14551809
] 

Eason Shen commented on CB-9040:
--------------------------------

I've capture the adb log, it says "URL blocked by whitelist: xxxxxx", while 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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message