Skip to content

Instantly share code, notes, and snippets.

Last active Jul 21, 2016
What would you like to do?
// Chain this onto the end of the AJAX request.
.then( () => {
// Create an array of <div>s and then map over each element to create a div with image and title.
const showImages = `
${ card => {
return `
<div class="col-md-6">
<div class="card">
<img src=${card.covers[0]} class="img-responsive" />
<div class="card-title">
// Remove any '' from the map array.
const imagesDiv = document.querySelector('#images');
imagesDiv.innerHTML = showImages;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment