function showAllPosts(text) {
    // Grab the pinboard div from the page
    pinboardElement = document.getElementById('pinboard');
    // Decode the post data
    postData = JSON.parse(text);
    // Clear the pinboard
    pinboardElement.innerHTML = '';
    // Loop through the postData
    postData.forEach(function (post) {
        console.log('here');
        // Show the item
        pinboardElement.innerHTML += '<div class="post"><a class="title" href="' + post.url + '">' + post.title + '</a><span class="meta">Posted ' + post.date + ' by ' + post.user + '</span></div>';
    });
    
    // TODO: Make the back button work
}
/**
 * Show all the posts on the page
 */
Show all the posts on the page
Show all the posts on the page
function showAllPosts(text) {
    pinboardElement = document.getElementById('pinboard');
    postData = JSON.parse(text);
    pinboardElement.innerHTML = '';
    postData.forEach(function (post) {
        console.log('here');
        pinboardElement.innerHTML += '<div class="post"><a class="title" href="' + post.url + '">' + post.title + '</a><span class="meta">Posted ' + post.date + ' by ' + post.user + '</span></div>';
    });
}
function showAllPosts ( text ) { pinboardElement = document . getElementById ( 'pinboard' ) ; postData = JSON . parse ( text ) ; pinboardElement . innerHTML = '' ; postData . forEach ( function ( post ) { console . log ( 'here' ) ; pinboardElement . innerHTML += '<div class="post"><a class="title" href="' + post . url + '">' + post . title + '</a><span class="meta">Posted ' + post . date + ' by ' + post . user + '</span></div>' ; } ) ; }
Show all the posts on the page
Show all the posts on the page
// Grab the pinboard div from the page // Decode the post data // Clear the pinboard // Loop through the postData // Show the item // TODO: Make the back button work