-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbook.html
More file actions
31 lines (30 loc) · 1.37 KB
/
book.html
File metadata and controls
31 lines (30 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Books Embedded Viewer API Example</title>
<script type="text/javascript" src="https://www.google.com/books/jsapi.js"></script>
<script type="text/javascript">
google.books.load();
function initialize() {
var viewer = new google.books.DefaultViewer(document.getElementById('viewerCanvas'));
var index = document.URL.indexOf('?');
if (index > 0) {
var bookIsbn = document.URL.substring(index, document.URL.length).split("=")[1]
console.log(bookIsbn);
}
//viewer.load('ISBN:0738531367'); //for test purpose
viewer.load('ISBN:'+bookIsbn);
}
google.books.setOnLoadCallback(initialize);
</script>
</head>
<body>
<div class="container">
<div class="text-center" id="viewerCanvas" style="width: device-width; height: 100%"></div>
</div>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
</body>
</html>