Answer the question
In order to leave comments, you need to log in
How to get all the information from the array using getJSON?
Hi, can you tell me what's wrong?
There is such an API array - mytest.ucoz.org/test.html
I need to get all nameEN and all year from this array.
I do this:
<div id="myblok"></div>
<script type="text/javascript">
$.getJSON('здесь ссылка на API',{},function (data) {
var html = '';
data.previewFilms[0].forEach(function(element) {
html += ' <div>'+element.nameEN+'</div> <div>'+element.year+'</div> ';
})
document.getElementById("myblok").innerHTML=html;
});
</script>
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