I retrieve json results using $.post() and I’d like to be able to print into a list for each result.
Using the following only displays the last json item
JQUERY
$.post('/assets/inc/account-info.php', qString, function (data) {
console.log(data);
var datas = jQuery.parseJSON(data);
console.log(datas);
$("#note").append("<li>id=recordsarray_"+datas.id+"><a href='#"+datas.id+"'>"+datas.name+"</a></li>");
});
I am assuming that you are getting array of objects in frontend and this object have id and name in it :