JSFiddle - React, Tailwind, and code Playground
HTML
<div id="one"></div>
JavaScript
$(document).ready(function () {
var response = {
"id": 32,
"title": "sascas",
"synopsis": "<p>cxcxcx</p>\r\n",
"body": "<p>cxccxxc</p>\r\n",
"created_at": "2014-09-25T14:12:06.345Z",
"updated_at": "2014-09-25T14:12:06.345Z",
"author": {
"name": "A test author",
"biography": "/system/authors/avatars/000/000/024/original/photo.JPG?1411472688",
"id": 24
},
"schools": {
"schools": [{
"id": 5,
"school_name": "Another london school Inner Circle Regent's Park, London",
"website": null,
"book_id": 32,
"created_at": "2014-09-25T14:12:06.413Z",
"updated_at": "2014-09-25T14:12:06.413Z"
}, {
"id": 6,
"school_name": "city of london school 107 Queen Victoria St London",
"website": null,
"book_id": 32,
"created_at": "2014-09-25T14:12:06.417Z",
"updated_at": "2014-09-25T14:12:06.417Z"
}]
}
};
// for (i = 0; i < response.schools.schools.length; i++) {
// var school = response.schools.schools[i];
// console.log( "id " + school.id + ", school_name: " + school.school_name );
//}
jQuery.each(response.schools.schools, function (i, school) {
console.log( "id " + school["id"] + ", school_name: " + school["school_name"] );
// console.log( "id " + school.id + ", school_name: " + school.school_name );
var text = $("#one").html();
$("#one").html( text + "<BR>"+ "id " + school["id"] + ", school_name: " + school["school_name"]);
});
});