forked from fredericd/coce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-client.html
32 lines (32 loc) · 1.08 KB
/
sample-client.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
<html>
<head>
<title>Coce Client Sample</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="coceclient.js"></script>
<script>
$(document).ready(function(){
var ids = [];
$("[id^=coce-thumbnail]").each(function(i) {
ids.push($(this).attr("class"));
});
if (ids.length == 0) return;
var coceClient = new CoceClient('http://localhost:8080', 'ol,gb,aws');
coceClient.fetch(ids, function(id, url) {
$("[id^=coce-thumbnail]."+id).each(function() {
var img = document.createElement("img");
img.src = url;
img.title = url;
$(this).append(img);
});
});
});
</script>
</head>
<body>
<span class="2251005714" id="coce-thumbnail1"/></span>
<span class="9780415480635" id="coce-thumbnail2"></span>
<span class="9780821417492" id="coce-thumbnail3"></span>
<span class="2847342257" id="coce-thumbnail4"></span>
<span class="9780563533191"id="coce-thumbnail5"></span>
</body>
</html>