Hi All, I'm new to JS, and I'm trying to make google books previewed on my website. It works fine but if the book(ISBN) is not available for previewing, which only gives me nothing on the page :(

What I need is it give me a alert, or some echos,which tells something like "this book is not available for Previewing" when the ISBN is not found. Here is my code used on a php, and also a JS with the link. http://www.google.com/jsapi

thanks xelawho, I mean everybook already has a ISBN in my DB, but not all of them are available for Previewing through GOOGLE API, only some of them.When I browse these books which were not available, the window returns me nothing but a white page. I want to say something on that page instead of nothing. :>

xelawho

09-27-2011, 01:28 PM

right.

so when you try to open a book and google doesn't have it, does firebug show an error? do you by chance have a link to your page?

xelawho

09-27-2011, 02:42 PM

never mind - it's here (http://code.google.com/apis/books/docs/viewer/developers_guide.html#Handling_failed_initializations) in the documentation...

Thanks again. It works this time, and I just followed the "Handling failed initializations" of GOOGLE DEV Guide, everything is right there.
function alertNotFound() {
alert("could not embed the book!");
}
// plus
viewer.load('ISBN:<?php echo $id; ?>', alertNotFound);