我无法使用Google Books API查看器来处理不仅仅是"预览"而是完全免费的"阅读"版本的图书.唯一的问题是,我没有看到"阅读"版本的ISBN,当我尝试将书籍"id"与Google图书API查看器一起使用时,它不起作用.让我解释.
以下是使用仅限预览的图书的Google图书API查看器的工作版本:
这是我用作预览的书的参考书:
<html>
<head>
<style type="text/css">
#viewer {width:700px;height:80%;padding:30px;margin-left:auto;margin-right:auto;margin-top:20px;background:#fff;box-shadow: 2px 2px 5px 4px #888888;border-radius:10px;}
#viewerCanvas {width:100%;height:100%;}
</style>
<title>Removing the Footer in Google Books Embedded Viewer API Example</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("books", "0");
function initialize() {
var display_options = {showLinkChrome: false};
var viewer = new google.books.DefaultViewer(document.getElementById('viewerCanvas'),display_options);
viewer.load('ISBN:1935626760', bookNotFound, removePreviewFooter);
}
function bookNotFound() {
document.getElementById('viewerCanvas').innerHTML="<h1>No Preview!</h1>";
}
function removePreviewFooter() {
$('#viewerCanvas > div > div:nth-child(2)').css('display','none');
}
google.setOnLoadCallback(initialize);
</script>
</head>
<body style="background:#ececec;">
<div id="viewer"> …Run Code Online (Sandbox Code Playgroud)