javascript - Return all values for the title JSON -
currently displaying 1 title of titles printed.
$.getjson("http://...", function (data) { $(".make-text").html(data.query.results.channel.item[0].title); });
demo
you need iterate on items.
$.getjson("...", function (data) { var titles = data.query.results.channel.item.map(function(item) { return item.title; }); $(".make-text").html(titles.join('<br>')); });
map used extract property of objects in array.
Comments
Post a Comment