X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=f6b4c43c7d7409a23385ee39c5273d7efc9d45c5;hb=73a78c97272fcd068f61469f868068cc94c723b4;hp=bff7a846bb5cbb724ab29d35857e7079c1e566c4;hpb=f6eef5eb519301635995e7a51f98f62921340dd8;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index bff7a84..f6b4c43 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -1,3 +1,5 @@ +(function() { + var board = []; var arrows = []; var arrow_targets = []; @@ -15,6 +17,9 @@ var request_update = function(board) { ims = xhr.getResponseHeader('X-Remoteglot-Last-Modified'); var num_viewers = xhr.getResponseHeader('X-Remoteglot-Num-Viewers'); update_board(board, data, num_viewers); + }).fail(function() { + // Wait ten seconds, then try again. + setTimeout(function() { request_update(board); }, 10000); }); } @@ -443,3 +448,5 @@ var init = function() { }); }; $(document).ready(init); + +})();