/[metastatus]/trunk/jar/content/metastatus/metastatus.js
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 /trunk/jar/content/metastatus/metastatus.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Wed Jul 14 14:12:27 2004 UTC (19 years, 10 months ago) by dpavlin
File MIME type: application/javascript
File size: 1103 byte(s)
initial import into subversion

1
2 var metaStatus = {
3 uri : 'http://localhost/~dpavlin/metastatus.cgi',
4 http : null,
5
6 check : function(funcPtr)
7 {
8 // safety check
9 if (!funcPtr)
10 return;
11
12 this.finished = funcPtr;
13 this.http = new XMLHttpRequest();
14
15 var self = this;
16 this.http.onreadystatechange = function()
17 {
18 self.response(self);
19 };
20
21 this.http.open('GET', this.uri, true);
22 this.http.send('');
23 },
24
25 response : function()
26 {
27 if (4 == this.http.readyState && 200 == this.http.status)
28 {
29 var dom = this.http.responseXML;
30 var users = dom.getElementsByTagName('user');
31 var results = {};
32 for (var i = 0; i < users.length; i++)
33 {
34 var name = users[i].getAttribute('name');
35 var data = {};
36 for (var c = 0; c < users[i].childNodes.length; c++)
37 {
38 var child = users[i].childNodes[c];
39 if (child.nodeType == 1) // is element
40 data[child.tagName] = child.childNodes[0].nodeValue;
41 }
42 results[name] = data;
43 }
44
45 this.finished(results);
46 }
47 }
48 }

  ViewVC Help
Powered by ViewVC 1.1.26