Answer the question
In order to leave comments, you need to log in
How to display the result separately?
good time of day). There is JS:
$(document).ready(function() {
$.ajax({
url: "data.json",
dataType: "text",
success: function(data) {
var json = $.parseJSON(data);
$.each(json, function(key,value) {
document.write('<div id="post">' + value.name + '</div>');
});
}
});
});
{"post1":{"name":"Hello!","rating":1,"img":"/p1.jpg"},"post2":{"name":"Launch new service","rating":1,"img":"/p2.jpg"}}
Hello!Launch new service
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question