I have a page where is some of JSON data stored like this
{
"video": {
"user": {
"first_name": "Curtis",
"last_name": "Shoch"
},
"name": "Darwin Digital",
"location": "Kennesaw",
"video_type": "c",
"created": "2018-01-16T13:11:11.326636Z"
}
}
I need to take this data and display it on another page, o I tried to do something like this
var getJSON = function(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('get', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
callback(null, xhr.response);
} else {
callback(status);
}
};
xhr.send();
};
getJSON('https://dev.truthify.com/api/deeplink/info/bf76b0bd-5210-4c55-af23-c9689ffec536/', function(err, data) {
if (err != null) {
alert('Something went wrong: ' + err);
} else {
result.innerText = video.name;
}
But I got a message
No Access-Control-Allow-Origin
Header is present on the requested resource because I am using source from another website and it is blocked. So is there any why to bypass this, or some other way to take this data.