I am using this ajax call in my code, but it triggers the error function everytime. Anyone have any idea why this is happening?
$.ajax({
type:'GET',
url: 'https://s3.amazonaws.com/GSTArticles/GoogleMaps/Landmarks.xml',
datatype: 'xml',
success: function(xml){
console.log(xml);
},
error: function(err){
alert("ERROR!");
}
});
To my understanding, the syntax looks correct. Can someone help me to see why this triggers an error, rather than placing the xml into my console? Thanks.
I also see this in the console: XMLHttpRequest cannot load https://s3.amazonaws.com/GSTArticles/GoogleMaps/Landmarks.xml. Origin null is not allowed by Access-Control-Allow-Origin.