I have a JSON file (https://github.com/conde-nast-international/cnid-tech-tests/blob/master/data/article.json) that has five array fields for an article: id, title, body, cover image, and url. But the body array has three embedded array objects (plaintext, pull_quote, and h2) that are not showing up.
I have no idea how to tackle this.
HTML:
<div id="container">
<table id="article_table" class="table table-bordered ">
<tr>
<th>ID</th>
<th>Title</th>
<th>Body</th>
<th>Cover Image</th>
<th>Url</th>
</tr>
</table>
</div>
JavaScript:
<script>
$(document).ready(function() {
$.getJSON("article.json", function(data){
console.log(data) //just to log in console as well
var article_data = '';
$.each(data, function(key, value){
article_data += '<tr>';
article_data += '<td>'+value.id+'</td>';
article_data += '<td>'+value.title+'</td>';
article_data += '<td>'+value.body+'</td>';
article_data += '<td>'+value.cover+'</td>';
article_data += '<td>'+value.url+'</td>';
article_data += '</tr>';
});
$('#article_table').append(article_data);
});
});
</script>
Whole page view:
Section with embedded array objects that wont display:


JSON.parseyour results.