/[RFID]/www/rfid.html
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /www/rfid.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 55 - (show annotations)
Fri Jun 26 11:27:32 2009 UTC (14 years, 10 months ago) by dpavlin
File MIME type: text/html
File size: 1111 byte(s)
extract callback function

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 got_visible_tags(data,textStatus) {
21 var html = 'No tags in range';
22 if ( data.tags ) {
23 html = '<ul class="tags">';
24 $.each(data.tags, function(i,tag) {
25 console.debug( i, tag );
26 html += '<li class=' + tag.security + '><tt>' + tag.sid + ' ' + tag.content + '</tt>';
27 });
28 html += '</ul>';
29 }
30 html = '<div class=status>'
31 + textStatus
32 + '##########'.substr(0,data.time % 10)
33 + '</div>'
34 + html
35 ;
36 $('#tags').html( html );
37 window.setTimeout(function(){
38 scan_tags();
39 },200); // re-scan every 200ms
40 };
41
42 function scan_tags() {
43 console.info('scan_tags');
44 $.getJSON("http://localhost:9000/scan?callback=?", got_visible_tags);
45 }
46
47 $(document).ready(function() {
48 scan_tags();
49 });
50 </script>
51 </head>
52 <body>
53
54 <h1>RFID tags in range</h1>
55
56 <div id="tags">
57 RFID reader not found or driver program not started.
58 </div>
59
60 </body>
61 </html>

  ViewVC Help
Powered by ViewVC 1.1.26