Main menu:

Site search

Feeds

Categories

July 2014
S M T W T F S
« Mar    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Archive

jQuery plugin for Google Books Search Viewability API

Matt Mitchell, one of the programmers on my team, just whipped up a neat little jquery plugin to easily display cover images and link to google books. We’re using it as part of Blacklight, and we’re making it available through the Blacklight source code repository under an Apache 2.0 license.

First, grab the plugin here, and download jquery here. Now make yourself some HTML that looks like this:

<html>
  <head>
    <script type=“text/javascript” src=“jquery-1.2.3.min.js”></script>
    <script type=“text/javascript” src=“gbsv-jquery.js”></script>
    <script type=“text/javascript”>
        $(function(){
                $.GBSV.init();
        });
    </script>
  </head>
  <body>
        <span title=“ISBN:0743226720″ class=“gbsv-link-to-preview”></span>
        <span title=“ISBN:0743226720″ class=“gbsv-link-to-info”></span>
        <span title=“ISBN:0743226720″ class=“gbsv-thumbnail”></span>
        <span title=“ISBN:0743226720″ class=“gbsv-link-to-preview-with-thumbnail”></span>
  </body>
  </html>

Now load your page and you should see something like this.

If you link to a non-existent ISBN it will be silently ignored.

Give it a shot and give us some feedback!

Comments

Comment from Dean
Time: March 17, 2008, 10:15 pm

Not seeing anything at the demo page. Just a blank screen?

Comment from bess
Time: March 18, 2008, 10:29 pm

Dean, I don’t know what to tell you. It works for me and it works every place I’ve tested it. What platform are you using? Could it have been a momentary network glitch? Try again?

Comment from Duane
Time: March 21, 2008, 2:33 pm

I too get a blank screen at the demo page. I’m using firefox on Ubuntu Linux.

Write a comment