I am trying to make an ajax request using jQuery from my local environment.
$.ajax({
url: requestURL,
dataType: "json",
timeout: 120000,
success: function(data){
// do something
},
error: function(XMLHttpRequest, textStatus, errorThrown){
console.log("Instants.loadGame: error loading games: error text: " + textStatus + "; error thrown: " + errorThrown);
}
});
I have tried using dataType json and jsonp (as that is what everyone else seems to say fixes the problem) but I get errors either way. With dataType json the error response has textStatus = "error" and errorThrown is empty. With dataType jsonp the error response has textStatus = "parsererror" and errorThrown = "jQuery19002007321439859855_1361446807440 was not called".
I know this code works when running on the same domain as my request URL so I can only assume it is because I am doing it on my local environment. I have set my cross-domain.xml to allow everything. I am using jQuery 1.9.0.
Does anyone have any ideas? I have been looking at this a lot online but none of the solutions that helped other people seem to work for me...
Thanks,
Heather