-
Notifications
You must be signed in to change notification settings - Fork 305
/
example.html
31 lines (31 loc) · 1.01 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="description" content="HTML5 QR Code Usage Example">
<script src="lib/jsqrcode-combined.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="lib/html5-qrcode.min.js"></script>
<script>
$(document).ready(function(){
$('#reader').html5_qrcode(function(data){
$('#result').html(data);
},
function(error){
$('#error').html("Scanning...");
}, function(videoError){
$('#error').html("Camera error.");
}
);
});
</script>
<title>HTML5 QR code Reader</title>
</head>
<body>
<h1>HTML5 QR Code Reader Usage Example</h1>
<span id="error" style='color:darkred;' class="center"></span>
<div id="reader" style="width:300px;height:250px"></div>
<span id="result" class="center"></span>
</body>
</html>