X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fxhr.js;h=fba80022a8453e75d8c8a65c832ab5694b51d00f;hb=2fc5f744b08dabc232c6a3cc370e9f788ab182ea;hp=30819dc22a4be902c5175ce383723ea4bdb9c46a;hpb=f18bac8374119fa1f3c826e82cfc74ce2ce52dd7;p=brisk.git diff --git a/web/xhr.js b/web/xhr.js index 30819dc..fba8002 100644 --- a/web/xhr.js +++ b/web/xhr.js @@ -16,13 +16,15 @@ * not, write to the Free Software Foundation, Inc, 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * */ var xhr_rd_cookiepath = "/brisk/"; var xhr_rd = false; var xhr_rd_stopped = true; var xhr_rd_oldctx = ""; -var xhr_rd_newctx; +var xhr_rd_newctx = ""; var xhr_rd_cur_n = -1; var xhr_rd_old_n = -1; @@ -87,9 +89,9 @@ function xhr_rd_poll(sess) /* heartbeat log */ - $("sandbox2").innerHTML += "_"; - if ($("sandbox2").innerHTML.length == 20) - $("sandbox2").innerHTML = "_"; + $("heartbit").innerHTML += "_"; + if ($("heartbit").innerHTML.length == 20) + $("heartbit").innerHTML = "_"; do { again = 0; @@ -110,7 +112,10 @@ function xhr_rd_poll(sess) else { xhrrestart = 1; try { - xhr_rd_newctx = xhr_rd.responseText; + if (xhr_rd == null) + throw "restart"; + if (xhr_rd.responseText != null) + xhr_rd_newctx = xhr_rd.responseText; } catch (e) { if (xhr_rd_stopped == true) { @@ -124,9 +129,9 @@ function xhr_rd_poll(sess) if (the_end != true) { watchdog = 0; setTimeout(xhr_rd_poll, tout, sess); - $("sandbox2").innerHTML += "-"; - if ($("sandbox2").innerHTML.length == 20) - $("sandbox2").innerHTML = "-"; + $("heartbit").innerHTML += "-"; + if ($("heartbit").innerHTML.length == 20) + $("heartbit").innerHTML = "-"; } return; } @@ -213,9 +218,9 @@ function xhr_rd_poll(sess) // $("sandbox").innerHTML += "return 3
"; if (the_end != true) { setTimeout(xhr_rd_poll, tout, sess); - $("sandbox2").innerHTML += "-"; - if ($("sandbox2").innerHTML.length == 20) - $("sandbox2").innerHTML = "-"; + $("heartbit").innerHTML += "-"; + if ($("heartbit").innerHTML.length == 20) + $("heartbit").innerHTML = "-"; } return; };