This repository has been archived by the owner on Jan 28, 2023. It is now read-only.
forked from coolaj86/isbnjs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
83 lines (83 loc) · 2.45 KB
/
index.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<title>ISBN Parser - isbnjs sample</title>
<style type="text/css">
div#title {
font-size: x-large;
}
input.value {
width: 150px;
background-color: #e0e0ff;
}
</style>
<script type="text/javascript" src="isbn.js"></script>
<script type="text/javascript">
<!-- <![CDATA[
function set(id, txt) {
document.getElementById(id).value = txt;
}
function parse() {
var txt = document.getElementById('isbn');
var isbn = ISBN.parse(txt.value);
if (isbn) {
set('result', 'good');
set('is_isbn_10', isbn.isIsbn10());
set('is_isbn_13', isbn.isIsbn13());
set('as_isbn_10', isbn.asIsbn10());
set('as_isbn_13', isbn.asIsbn13());
set('as_isbn_10_t', isbn.asIsbn10(true));
set('as_isbn_13_t', isbn.asIsbn13(true));
set('codes_groupname', isbn.codes.groupname);
} else {
set('result', 'bad');
}
}
// ]]> -->
</script>
</head>
<body>
<div id="title">ISBN Parser - isbnjs sample</div>
<div>
ISBN:
<input id="isbn" type="text" value="9784873113685" />
<input id="parse" type="button" value="parse" onclick="parse()" />
</div>
<table>
<tr>
<td>result</td>
<td><input id="result" class="value" type="text" readonly="readonly" /></td>
</tr>
<tr>
<td>isIsbn10()</td>
<td><input id="is_isbn_10" class="value" type="text" readonly="readonly" /></td>
</tr>
<tr>
<td>isIsbn13()</td>
<td><input id="is_isbn_13" class="value" type="text" readonly="readonly" /></td>
</tr>
<tr>
<td>asIsbn10()</td>
<td><input id="as_isbn_10" class="value" type="text" readonly="readonly" /></td>
</tr>
<tr>
<td>asIsbn13()</td>
<td><input id="as_isbn_13" class="value" type="text" readonly="readonly" /></td>
</tr>
<tr>
<td>asIsbn10(true)</td>
<td><input id="as_isbn_10_t" class="value" type="text" readonly="readonly" /></td>
</tr>
<tr>
<td>asIsbn13(true)</td>
<td><input id="as_isbn_13_t" class="value" type="text" readonly="readonly" /></td>
</tr>
<tr>
<td>codes.groupname</td>
<td><input id="codes_groupname" class="value" type="text" readonly="readonly" /></td>
</tr>
</table>
</body>
</html>