dojo.byId("output").appendChild(p);
}
-function hello() {
+function get_next_update() {
dojo.xhrGet( {
// The following URL must match that used to test the server.
url: "/eow/update",
handleAs: "javascript",
//handleAs: "text",
- timeout: 5000, // Time in milliseconds
+ timeout: 30000, // Time in milliseconds
// The LOAD function will be called on a successful response.
load: function(response, ioArgs) {
// The ERROR function will be called in an error case.
error: function(response, ioArgs) {
- console.error("HTTP status code: ", ioArgs.xhr.status);
- return response;
+ if (response.dojoType == "timeout") {
+ ioArgs.xhr.abort();
+ get_next_update();
+ return response;
+ }
+
+ console.error("HTTP status code: ", ioArgs.xhr.status);
+ return response;
}
});
}
+function prompt(minutes, btus) {
+ eowOut("[" + minutes + "," + btus + "]: ");
+ get_next_update();
+}