Skip to content Skip to sidebar Skip to footer

Cordova Cors Call Not Working

I don't understand why, but my CORS call is not working. I added the meta tag to index.html

Solution 1:

OK the solution was so stupid, I searched way to long for this

var request = newXMLHttpRequest();
request.open("GET", "http://XXXXXXXXXX/XXXXX", true);
console.log("test");
request.send()
request.onreadystatechange = function () {
console.log("DOES NOT COME HERE?")
if (request.readyState == 4) {
    if (request.status == 200 || request.status == 0) {
        alert(code);
        var product = JSON.parse(request.responseText);
        alert(product.CNK);
    }
}

As you see I added request.send() :)

Post a Comment for "Cordova Cors Call Not Working"