1 |
<html> |
2 |
<head> |
3 |
<title>3M RFID</title> |
4 |
<script type="text/javascript" src="jquery-1.3.2.min.js"></script> |
5 |
<script type="text/javascript"> |
6 |
|
7 |
function scan_tags() { |
8 |
console.info('scan_tags'); |
9 |
$.getJSON("http://localhost:9000/scan?callback=?", |
10 |
function(data) { |
11 |
var html = 'No tags in range'; |
12 |
if ( data.tags ) { |
13 |
html = '<ul class="tags">'; |
14 |
$.each(data.tags, function(i,tag) { |
15 |
console.debug( i, tag ); |
16 |
html += '<li>' + tag.sid + ' <tt>' + tag.content + '</tt>'; |
17 |
}); |
18 |
html += '</ul>'; |
19 |
} |
20 |
$('#tags').html( html ); |
21 |
window.setTimeout(function(){ |
22 |
scan_tags(); |
23 |
},200); // re-scan every 200ms |
24 |
}); |
25 |
} |
26 |
|
27 |
$(document).ready(function() { |
28 |
scan_tags(); |
29 |
}); |
30 |
</script> |
31 |
</head> |
32 |
<body> |
33 |
|
34 |
<h1>RFID tags in range</h1> |
35 |
|
36 |
<div id="tags"> |
37 |
RFID reader not found or driver program not started. |
38 |
</div> |
39 |
|
40 |
</body> |
41 |
</html> |