Hello, I am rather stuck on a task, and would really appreciate some help.
I am try to get statistics through a external API, which returns some json data. I would then like to display this data on my store front. This is my current code to fetch the data.
jQuery.ajax({
url: 'some-url',
dataType: 'json'
})
.done(function(result){
var value = result.data[0].value;
document.getElementById('data').innerHTML = value;
})
.fail(function() {
console.log('Error fetching data')
});
However I keep getting the following error.
'Access to XMLHttpRequest at "....." from origin "...." has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. '
Could someone please help or guide me on how to get around this.
Many thanks
User | Count |
---|---|
24 | |
23 | |
22 | |
19 | |
13 |