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