/[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

Annotation of /www/rfid.html

Parent Directory Parent Directory | Revision Log Revision Log


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

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 dpavlin 54
10     .da {
11     background: #fcc;
12     }
13    
14     .d7 {
15     background: #cfc;
16     }
17 dpavlin 52 </style>
18 dpavlin 47 <script type="text/javascript">
19    
20 dpavlin 55 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 dpavlin 47 function scan_tags() {
43     console.info('scan_tags');
44 dpavlin 55 $.getJSON("http://localhost:9000/scan?callback=?", got_visible_tags);
45 dpavlin 47 }
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