Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function listPoets(data) {
- var output='';
- var val = '';
- $.each(data.posts,function(key,val) {
- console.log(val.thumbnail);
- output += '<div data-role="collapsible">';
- output += '<h3>' + val.title + '</h3>';
- if (val.thumbnail !== 'undefined') {
- output += '<img src="' + val.thumbnail + '" alt="' + val.title + '"/>';
- } else {
- output += '<img src="images/WSLogo.jpg" alt="Word Salad Logo"/>';
- }
- output += val.content;
- output += '</div>';
- }); // go through each post
- $('#poetslist').html( $(output) );
- } // lists all the poems
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement