From 8d337ccca1a09d8fb3c03e70d6209ae5427eb549 Mon Sep 17 00:00:00 2001 From: Gerd Flaig Date: Sun, 23 Aug 2009 21:24:23 +0200 Subject: [PATCH 1/1] Update: retry on timeout --- static/eow.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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) { -- 2.43.0