]> git.pond.sub.org Git - eow/blobdiff - static/eow.js
Update testcase
[eow] / static / eow.js
index b3f27ed5cd6d32414ad3c460635ba66401c1d218..631894f0b70ff92059ca0daa4dddb03d8bb3c4e2 100644 (file)
@@ -11,14 +11,25 @@ function setup() {
 
 function eowOut(output) {
   $("#output").append("<pre>" + output + "</pre>");
 
 function eowOut(output) {
   $("#output").append("<pre>" + output + "</pre>");
-  window.scrollTo(0, window.scrollMaxY);
+  $("input")[0].scrollIntoView(false);
 }
 
 function get_next_update() {
 }
 
 function get_next_update() {
-  $.getScript("/eow/update", function(data, textStatus) {
-      console.log(textStatus);
-      return data;
-    });
+  $.ajax({
+    url: "/eow/update",
+    dataType: "script",
+    success: function(data, textStatus) {
+       console.log(textStatus + " " + data);
+    },
+    error: function(xhr, textStatus, error) {
+      if (textStatus == "timeout") {
+       xhr.abort();
+       next();
+      }
+
+      console.error("HTTP status code: ", xhr.status);
+    }
+  });
 }
 
 function submit_cmdline(command) {
 }
 
 function submit_cmdline(command) {