Just want to display the reviews using jquery but it displays only the last review. Could you help me please.
$.each(data.results, function(i, res) {
var item = $('<div>'),
head = $('<h4>'),
info = $('<p>');
head.html(res.title);
info.html(res.review_text+'<hr>');
item.append(head,info);
$("#review_list").html(item);
});
Update:
Actually I tried in this way and it worked without using append.
var item = $('<div>'); // moved item outside loop
$.each(data.results, function(i, res) {
var head = $('<h4>'),
info = $('<p>');
head.html(res.title);
info.html(res.review_text+'<hr>');
item.append(head,info);
});
$("#review_list").html(item); // used html outside loop