Answer the question
In order to leave comments, you need to log in
How to get jsonp data?
Hello!
The server supports jsonp request. I use this code:
var URL; // сама ссылка на json файл.
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.addEventListener('load', function(evt) {
if (xhr.status === 200) {
console.log(xhr.response);
} else {
console.error(xhr.status);
}
});
xhr.open('GET', URL);
xhr.send();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question