/[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 52 - (hide annotations)
Wed Jun 24 10:20:20 2009 UTC (14 years, 11 months ago) by dpavlin
File MIME type: text/html
File size: 1013 byte(s)
ship time to javascript and draw poor man's progress bar with last 10 seconds

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>

  ViewVC Help
Powered by ViewVC 1.1.26