I am using the following code to make a ajax request, in Cordova app
$.ajax(rssUrl, {ct: id, crossDomain: true}).done(
function (data, textStatus, jqXHR) {
var object = $(this); //extracting context
var cntxt = object[0].ct;
rssReader.parse(data, textStatus, jqXHR, true, cntxt)
}
)
.fail(alErr);
This request is working fine in the ripple emulators,but doing a build on Physical android device I keep getting the alErr output (the status and readyState of jqXHR object is 0)
Specfically this is not working for http://www.footballnewsguru.com/feeds/posts/default/-/Liverpool?alt=json&max-results=10 It works for other feeds i am accessing
The first answer from jQuery Ajax - Status Code 0? does not seem to be for my app, as the CSP is allowing the request in emulators, there is no DNS problem.
I have been searching for a solution for hours, but mostly they are about the browser refreshing or form submitting before ajax request is sent, but neither are applicable to my case.
[EDIT]
<meta http-equiv="Content-Security-Policy" content="default-src 'self' * data: gap: https://ssl.gstatic.com 'unsafe-inline' 'unsafe-eval'; img-src * data:; style-src 'self' 'unsafe-inline';">
here is the meta for CSP. Encoding the URL did not work either.