I can't figure out how to make a cross domain ajax call. My code is this:
$.ajax({
type: "GET",
url: "http://csgolounge.com/availableweapons",
cache: false,
dataType: "xml",
success: function(data) {
console.log(data);
}
});
But this gives me this error, due to the same-origin policy:
XMLHttpRequest cannot load http://csgolounge.com/availableweapons?_=1413931403643. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
I've seen a few other solutions using jsonp but this is xml data, not json. I've seen others using a php proxy but I've never used php before. I just want to be able to read the xml at http://csgolounge.com/availableweapons into a variable so I can parse it on my own.