-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
36 lines (32 loc) · 1.12 KB
/
index.html
File metadata and controls
36 lines (32 loc) · 1.12 KB
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
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" >
<title>PhoneGap</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="phonegap.js"></script>
<script src="barcodescanner.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("button").click(function(){
window.plugins.barcodeScanner.scan(
function(result) {
if (result.cancelled)
alert("the user cancelled the scan")
else
$('body').append(result.text);
alert("we got a barcode: " + result.text);
},
function(error) {
alert("scanning failed: " + error)
});
});
});
</script>
</head>
<body onload="init();" id="stage" class="theme">
<button>Get Card</button>
</body>
</html>