]> git.pond.sub.org Git - eow/blob - static/eow.js
Add thread safe queue. Use to push updates to client.
[eow] / static / eow.js
1 function eowOut(output) {
2   var t = document.createTextNode(output);
3   var p = document.createElement("p");
4   p.appendChild(t);
5   dojo.byId("output").appendChild(p);
6 }
7
8 function hello() {
9   dojo.xhrGet( {
10     // The following URL must match that used to test the server.
11     url: "/eow/update", 
12     handleAs: "javascript",
13     //handleAs: "text",
14
15     timeout: 5000, // Time in milliseconds
16
17     // The LOAD function will be called on a successful response.
18     load: function(response, ioArgs) {
19       console.log(response);
20       return response;
21     },
22
23     // The ERROR function will be called in an error case.
24     error: function(response, ioArgs) {
25       console.error("HTTP status code: ", ioArgs.xhr.status);
26       return response;
27     }
28   });
29 }
30