-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
34 lines (28 loc) · 1.04 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>NFC Tools KBC - Test Page</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="nfctools.kbc.js"></script><!-- Import NFC Tools KBC script -->
<script type="text/javascript" >
// Wait for the HTML document has been completely loaded and parsed
document.addEventListener("DOMContentLoaded", function(event) {
// Here we register a callback function to get the NFC tag's content
NFCToolsKBC.getInstance().registerCallback(function(content){
// Do what you want here with the content
// For the demo, we show the content in a HTML element
var target = document.getElementById("kbc-target");
target.innerHTML = "Content detected: " + content;
});
});
</script>
</head>
<body>
<div>
<h1>Welcome to NFC Tools KBC - Test Page</h1>
<p>Launch NFC Tools KBC, focus this web page then scan a tag. Current status:</p>
<p id="kbc-target">Waiting for a tag</p>
</div>
</body>
</html>