forked from burga05/webcodecamjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple.html
27 lines (27 loc) · 916 Bytes
/
simple.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h3>Simple initalization with default settings</h3>
<hr>
<canvas></canvas>
<hr>
<ul></ul>
<script type="text/javascript" src="js/qrcodelib.js"></script>
<script type="text/javascript" src="js/webcodecamjs.js"></script>
<script type="text/javascript">
var txt = "innerText" in HTMLElement.prototype ? "innerText" : "textContent";
var arg = {
resultFunction: function(result) {
var aChild = document.createElement('li');
aChild[txt] = result.format + ': ' + result.code;
document.querySelector('body').appendChild(aChild);
}
};
new WebCodeCamJS("canvas").init(arg).play();
</script>
</body>
</html>