I have problem with looping through JSON, my example prints only last block of JSON.
JSON example:
[{
"date": "May 15 2015 12:00:00:000AM",
"link": "somelink1.pdf"
}, {
"date": "May 15 2015 12:00:00:000AM",
"link": "somelink2.pdf"
}
]
jQuery part:
$.getJSON("PlaceOfMyJSON.php", function(response) {
$.each(response, function (i, item) {
$('#result').html(item.link);
});
});
In live JSON I have many data but this loop print only last "link" field "somelink2.pdf" in my div with id result.