Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 838527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:19:09+00:00 2026-05-15T05:19:09+00:00

For the last few hours I’ve been trying to set up this http://code.google.com/apis/books/docs/dynamic-links.html on

  • 0

For the last few hours I’ve been trying to set up this http://code.google.com/apis/books/docs/dynamic-links.html on a WordPress blog. Google’s API sends back a JSON response (which is supposed to be “put” into _GBSBookInfo variable). However, that variable never is assigned so my javascript callback function explodes saying the variable doesn’t exist. So far, all of my javascript is in the WordPress header.

I tried this outside of WordPress and it works fine.

This is the static page:

<script src="http://books.google.com/books?bibkeys=0307346609&jscmd=viewapi&callback=response_handler">

This is the handler:

function response_handler(data) { 
   var bookInfo = _GBSBookInfo["0307346609"]; // the var that doesn't exist
   document.getElementById("test123").innerHTML = bookInfo.thumbnail_url;
} 

Thanks for any help in advance, WordPress has been extremely frustrating by limiting so much! If I’m doing anything stupid please say so, I’m a new javascript programmer.

EDIT:

I’ve used firebug so far to identify the problem to be: the _GBSBookInfo variable never gets “created” or “exists”. I’m not sure how javascript works at this level. Hopefully this helps.

ERRORS:

Error: _GBSBookInfo is not defined
Line: 79

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:19:10+00:00Added an answer on May 15, 2026 at 5:19 am

    Try replacing _GSBookInfo with data, like so:

    function response_handler (data) {
        var bookInfo = data["0307346609"];
        document.getElementById("test123").innerHTML = bookInfo.thumbnail_url;
    }
    

    Based on your post, google returns this:

    response_handler({
        "0307346609": {
            "bib_key":"0307346609",
            ....
            "thumbnail_url":"http://bks2.books.google.com/books?somethumbnailstuff"
        }
    });
    

    … so the above code should work for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get jquery.autocomplete (http://docs.jquery.com/Plugins/autocomplete) to work for the last few
I have been struggling for the last few hours trying to get this search
I am having this array. Last few hours I have been trying to loop
I have been trying to remove this Firebug Console Error from last few hours.
I've been trying to figuring this out for the last few hours, and I'm
i spent last few hours trying to find what is wrong in my code(?)
I've been spending the last few hours trying to find the memory leak in
I've been trying over the last few hours to implement a jQuery easing effect
I've been pulling my hair out for the last few hours with this problem.
This has been plaguing me for the last few hours, I'm recieving the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.