X-Git-Url: http://git.pond.sub.org/?p=eow;a=blobdiff_plain;f=static%2Feow.js;h=631894f0b70ff92059ca0daa4dddb03d8bb3c4e2;hp=b3f27ed5cd6d32414ad3c460635ba66401c1d218;hb=d0df339544e58ba26876518ca78eedc1ebb72583;hpb=7beca26e6ea91745cd397ad69ac6e26bb934e683 diff --git a/static/eow.js b/static/eow.js index b3f27ed..631894f 100644 --- a/static/eow.js +++ b/static/eow.js @@ -11,14 +11,25 @@ function setup() { function eowOut(output) { $("#output").append("
" + output + "
"); - window.scrollTo(0, window.scrollMaxY); + $("input")[0].scrollIntoView(false); } 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) {