Reputation: 918
I am trying to download a file from website/s and it just throws an error about Access-Control. can anyone teach me how to make this code work? thanks in advance
var jqxhr = $.get("http://www.somewebsite.com/matodb.csv", function() {
alert("success");
})
.success(function() { alert("second success"); })
.error(function() { alert("error"); })
.complete(function() { alert("complete"); });
Upvotes: 0
Views: 414
Reputation: 23552
You can not make AJAX queries to other domains for security reasons (Same origin policy).
Upvotes: 1