function alertNotFound() {
alert("could not embed the book!");
}
function initialize() {
var viewer = new google.books.DefaultViewer(document.getElementById('viewerCanvas'));
viewer.load('ISBN:isbn13', alertNotFound);
}
google.setOnLoadCallback(initialize);
</script>
I need to figure out how to either add the validation to the script I am currently using or to add the optional { 'showLinkChrome': false } to the later script. I have tried adding this optional parameter to the DefaultViewer but this doesn't work.
Has anyone successfully implemented both of these. The documentation for optional parameters on google is pretty useless and the support forum doesn't provide any information either.
Member
5 Points
41 Posts
using google books api
Apr 27, 2010 05:20 PM|royalhale|LINK
I have successfully used the below code to embed a google book preview into my website.
<script type='text/javascript' src='http://books.google.com/books/previewlib.js'></script>
<script type='text/javascript'>
GBS_setViewerOptions({'showLinkChrome': false });
GBS_insertEmbeddedViewer('ISBN:" + isbn13 + "',630,675);
</script>
I needed to remove the bottom bar that provided other site's prices.
I now have to also check if the item is returned when passing the isbn. The sample code provided looks like the below.
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("books", "0");
function alertNotFound() {
alert("could not embed the book!");
}
function initialize() {
var viewer = new google.books.DefaultViewer(document.getElementById('viewerCanvas'));
viewer.load('ISBN:isbn13', alertNotFound);
}
google.setOnLoadCallback(initialize);
</script>
I need to figure out how to either add the validation to the script I am currently using or to add the optional { 'showLinkChrome': false } to the later script. I have tried adding this optional parameter to the DefaultViewer but this doesn't work.
Has anyone successfully implemented both of these. The documentation for optional parameters on google is pretty useless and the support forum doesn't provide any information either.
Thanks
Royal
Royal
Contributor
2594 Points
578 Posts
Re: using google books api
Apr 28, 2010 02:05 AM|Jalpesh P. Vadgama|LINK
Here is the link that might help you.
http://www.google.com/support/forum/p/booksearch-apis/thread?tid=2fa2073a446ebe8b&hl=en
Microsoft MVP(Visual C#),Computer Geek,Lifelong Learner
My Technology Blog : www.dotnetjalps.com
Mark as answer if my anwers helps you