From 890747cec77b477585fecbae3895ce51a56a1e7e Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Mon, 30 Jun 2008 21:04:28 +0000 Subject: [PATCH] 2 ways asyncronous responses --- web/commons.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/commons.js b/web/commons.js index bbeccf1..3207c11 100644 --- a/web/commons.js +++ b/web/commons.js @@ -222,12 +222,17 @@ function createXMLHttpRequest() { function send_mesg(mesg) { var xhr_wr = createXMLHttpRequest(); - + var is_conn = (sess == "not_connected" ? false : true); - xhr_wr.open('GET', 'index_wr.php?sess='+sess+'&mesg='+mesg, true); + xhr_wr.open('GET', 'index_wr.php?'+(is_conn ? 'sess='+sess+'&' : '')+'mesg='+mesg, (is_conn ? true : false)); xhr_wr.onreadystatechange = function() { return; }; xhr_wr.send(null); + if (!is_conn) { + if (xhr_wr.responseText != null) { + eval(xhr_wr.responseText); + } + } } /* Stat: CHAT and TABLE */ -- 2.17.1