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 6958671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:10:15+00:00 2026-05-27T15:10:15+00:00

I am attempting to access Google Books in order to an ISBN Code to

  • 0

I am attempting to access Google Books in order to an ISBN Code to get details of a book, I have a number of problem, which are:

A) I am trying to assemble a script request e.g. with the ISBN code concatenated into the URL. I have not managed to do this successfully – and I don’t know why.

B) I then want to update a div in the DOM with this generated script dynamically, such that it will then execute.

C) I am finding it a bit of a puzzle as to the format of the returned data and the argument name of the function call contained in the Google response.

Has anyone else encountered the same problem and can offer guidance re A thru C above.

I enclose JavaScript code below.

        $(document).ready(function() {

            $('#viewbook-button').live('click', function() {
              isbnCode = this.text;

              alert("ISBN is : " + isbnCode + " " + this.text + " as well");

              alert("Getting JSONP Google Books data");

              isbnCode = "0451526538";

              JSONPstr = '<' + 'script ' + 'src="' + 'https://www.googleapis.com/books/v1/volumes?q=ISBN' + isbnCode; 
              JSONPstr = JSONPstr + '&callback=handleJSONPResponse">' + '</script>';

              alert("un-Escaped JSONP string" + JSONPstr);

              escJSONPstr = escape( escJSONPstr );

              alert("Escaped JSONP string");

              //divstr = "";
              //divstr = divstr + escape(<script src=");
              //divstr = divstr + encodeURIComponent(https://www.googleapis.com/books/v1/volumes?q=ISBN); 
              //divstr = divstr + escape(isbnCode);
              //divstr = divstr + encodeURIComponent(&callback=handleJSONPResponse);
              //divstr = divstr + escape("></);
              //divstr = divstr + escape(script);
              //divstr = divstr + escape(>);


              $('#jsonp-call').html(escJSONPstr);

              // This will cause the handleJSONPResponse function to execute when the script is dynamically loadedinto div.
              // The data wrapped in a function call will be returned from the Google Books server.
              // This will cause the handleJSONPResponse function to execute below.

            });   // end viewbook-button
        });       // end document.ready

        function handleJSONPResponse(response) {
          var tmp = response;
          alert(tmp);

        };

  </script>


  </head>

  <body> 
    <h2>Show Details of Books Ordered by a Customer</h2>
    <a href="#" id="getcusts-button">Get Customer Details</a>
    <br/><br/>
    <div id="tablist">Tables will be Listed Here</div>
    <br/><br/>
    <div id="Google-call">The JSONP generated src= statement will go here and execute</div>

  </body>
</html>

EDIT:

Problem solved – thanks everyone.

  • 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-27T15:10:16+00:00Added an answer on May 27, 2026 at 3:10 pm

    You’re reinventing the wheel: jQuery has built-in JSONP support, so you don’t need to faff about implementing it yourself. Use the $.ajax method:

    $.ajax({
        url: 'https://www.googleapis.com/books/v1/volumes?q=ISBN' + isbnCode,
        dataType: 'jsonp',
        success: function(response) {
            console.log(response);  // log the response object to the console
        }
    });
    

    That should be all you need to do.

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

Sidebar

Related Questions

We have a scenario where some .NET code is attempting to access the current
I have a scripts designed to access an online API (Google Search Appliance), which
I am attempting to access the Google Search Appliance API: http://code.google.com/apis/searchappliance/documentation/612/gdata/acapi_protocol.html In order to
I have a shared/ folder in my my_app/public/ folder and when attempting to access
I'm attempting to access the value of a hidden field in a form which
While attempting to access a test portal, I'm encountering the following problem while using
I'm attempting to access a grandchild object. I have 3 Objects, Opportunity, Quote, QuoteLineItems,
I am attempting to access a contact's phone number in PhoneGap Cordova 1.6.1 and
I am attempting to access a queue and receiving an access denied error. The
Am interoping a c++ dll and am attempting to access it's functions. Below is

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.