javascript - Looping throught json -


i'm writing ajax post request. problem don't know how loop throught json. on success got function:

.done(function ( data ) {   $('#records').append(data); }); 

and prints content #records this:

0: {id: 1, user_id: 1, title: "first", created_at: "2015-05-15 06:50:21",…} 1: {id: 2, user_id: 2, title: "second", created_at: "2015-05-15 06:50:38",…} 2: {id: 3, user_id: 3, title: "third", created_at: "2015-05-15 06:50:41",…} 3: {id: 4, user_id: 4, title: "fourth", created_at: "2015-05-15 06:50:45",…} 

how loop throught id's , pick it's content (1,2,3,4)? in advance!

.done(function ( data ) {     $.each(data, function(item) {         $('#records').append(item.id);     }); 

});


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -