I'm creating a web app that queries 10 wikipedia entries using the mediapedia API and displays each of them in blocks.
Here's the json:
What I want to do is display these entries all in blocks one below each other.
So I was thinking of using a for loop
to iterate through each entry and then using jQuery to append each block layered from top to bottom. How would I accomplish this?
Here's my codepen for simplicity: http://codepen.io/tadm123/pen/oBqwYZ
My attempt to iterate and append entries to blocks:
for(var i=0;i<10;i++)
{
title = a[1][i];
descr = a[2][i];
link =a[3][i];
var b = $('<a href = "' + link '"><div class="panel panel-info"><p class="panel-heading">' + title + '</p><p class="panel-body">' + descr + '</p></div></a>');
$('#block').append(b);
}
I'd appreciate any help. Thanks.