-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscanQr.html
42 lines (37 loc) · 1.21 KB
/
scanQr.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h3>Simple initalization with default settings and build select menu</h3>
<hr>
<canvas></canvas>
<hr>
<select></select>
<hr>
<ul></ul>
<!--Script ScanQr-->
<script type="text/javascript" src="jsScan/jquery.js"></script>
<script type="text/javascript" src="jsScan/qrcodelib.js"></script>
<script type="text/javascript" src="jsScan/webcodecamjquery.js"></script>
<script type="text/javascript" src="jsScan/filereader.js"></script>
<script type="text/javascript">
var arg = {
resultFunction: function(result) {
$('body').append($('<li>' + result.format + ': ' + result.code + '</li>'));
}
};
var decoder = $("canvas").WebCodeCamJQuery(arg).data().plugin_WebCodeCamJQuery;
decoder.buildSelectMenu("select");
decoder.play();
/* Without visible select menu
decoder.buildSelectMenu(document.createElement('select'), 'environment|back').init(arg).play();
*/
$('select').on('change', function() {
decoder.stop().play();
});
</script>
</body>
</html>