Created
April 1, 2009 01:24
-
-
Save adampolselli/88491 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseResponse(data) { | |
var bookshelf = document.getElementById("bookshelf"); | |
for (var i=0; i<6; i++) { | |
var cover = data.reader_books[i].book_edition.covers.cover_medium; | |
var title = data.reader_books[i].book_edition.title; | |
var permalink = data.reader_books[i].permalink; | |
var link = document.createElement("a"); | |
link.setAttribute("href",permalink); | |
var img = document.createElement("img"); | |
img.setAttribute("src",cover); | |
img.setAttribute("alt",title); | |
if (i % 2 == 0) { | |
img.setAttribute("class","odd"); | |
} | |
link.appendChild(img); | |
bookshelf.appendChild(link); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment