for a white i am working an api problem but always face this problem and cant find any solution. Here is my ajax request
$(document).ready(function() {
var url = 'https://www.xeno-canto.org/api/2/recordings?query=bearded+bellbird';
$.ajax({
url: url,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
type: "GET",
dataType: "json",
data: {},
success: function(result) {
console.log(result);
},
error: function() {
console.log("error");
}
});
});
but in chrome console this result show up
Access to XMLHttpRequest at 'https://www.xeno-canto.org/api/2/recordings?query=Greater+Scaup' from origin 'https://www.birdpx.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Do you have any solition?