]> git.pond.sub.org Git - eow/blob - static/eow.js
README placeholder
[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/static/ajax.txt", 
12     handleAs: "javascript",
13
14     timeout: 5000, // Time in milliseconds
15
16     // The LOAD function will be called on a successful response.
17     load: function(response, ioArgs) {
18       console.log(response);
19       return response;
20     },
21
22     // The ERROR function will be called in an error case.
23     error: function(response, ioArgs) {
24       console.error("HTTP status code: ", ioArgs.xhr.status);
25       return response;
26     }
27   });
28 }
29