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