I am creating an Android Cordova 4.0 jQuery Mobile 1.4.2 Android application and am having problems with a specific AJAX call. I searched for similar questions and already implemented solutions there without success.
Here's what happens:
I have the following AJAX call:
var request = $.ajax({ type: "GET" , crossDomain: true, url: 'http://pubads.g.doubleclick.net/gampad/adx?iu=/XXX/YYY&sz=300x50&c=123456789' }); request.done(function (response, textStatus, jqXHR){ console.log(response); }); request.fail(function (jqXHR, textStatus, errorThrown){ console.error("DFP Plugin Error: " + textStatus, errorThrown); });
When I run my application in my browser, this request works fine. However, when I create and debug the application from a real device , the request does not give this error: {"readyState":0, "responseText":"", "status":0, "statusText":"error"}
I have already included $.support.cors = true; and $.mobile.allowCrossDomainPages = true; , and I already have <access origin="*" />) in my config.xml file.
Can someone help me figure out what the problem is?
source share