Skip to content

Instantly share code, notes, and snippets.

@fixlr
Created May 6, 2011 21:02
Show Gist options
  • Save fixlr/959777 to your computer and use it in GitHub Desktop.
Save fixlr/959777 to your computer and use it in GitHub Desktop.
ProcessGBSBookInfo() fix
<script>
// Function to process GBS info and update the dom.
function ProcessGBSBookInfo(booksInfo) {
for (isbn in booksInfo) {
var url_elem = document.getElementById(isbn);
var pic_elem = document.getElementById("google_book");
var gbs_elem = document.getElementById("GBSDiv");
var bookInfo = booksInfo[isbn];
if (bookInfo) {
gbs_elem.innerHTML="<fieldset style='width:100px'><div align=center></div></fieldset>";
if (bookInfo.thumbnail_url) {
gbs_elem.innerHTML="<fieldset style='width:100px'><div align=center><a href=" + bookInfo.info_url +" style='text-decoration:none' target='_blank'><img src=\"" + bookInfo.thumbnail_url + "\" width=\"52\" /><br>Link to Google Books</a></div></fieldset>";
}
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment