Code: Select all
$.ajax({ type: "GET", url: "https://jsonplaceholder.typicode.com/comments", dataType: 'json', success: function (comment) {
console.log(comment);
commentsOn();
}
});
function commentsOn(comments) {
$("#comm").append(
"postId:" + comments.postId +
"ID:" + comments.id + "" +
"Name:" + comments.name + "" +
"Email:" + comments.email + "
" +
"Body:" + comments.body + "" + ""
);
}