From: Gerd Flaig Date: Sun, 23 Aug 2009 19:24:23 +0000 (+0200) Subject: Update: retry on timeout X-Git-Url: http://git.pond.sub.org/?p=eow;a=commitdiff_plain;h=8d337ccca1a09d8fb3c03e70d6209ae5427eb549 Update: retry on timeout --- diff --git a/static/eow.js b/static/eow.js index b3f27ed..2379559 100644 --- a/static/eow.js +++ b/static/eow.js @@ -15,10 +15,21 @@ function eowOut(output) { } 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) {