From 953b0041bf74bb410902b664458b21159ff6a8c7 Mon Sep 17 00:00:00 2001 From: sostler Date: Sat, 9 Jan 2010 16:47:35 -0500 Subject: Add message to page before sending to server --- static/pichat.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'static') diff --git a/static/pichat.js b/static/pichat.js index 3267b49..4384ed0 100755 --- a/static/pichat.js +++ b/static/pichat.js @@ -62,6 +62,8 @@ function submitMessage() { PostedMessages.push(content); $('#msgInput').val(''); + updateUI([{ 'nick': Nick, 'content': content}], null); + var onSuccess = function(json) {}; var onError = function(resp, textStatus, errorThrown) { $('#msgInput, #msgSubmit').removeAttr('disabled'); @@ -77,9 +79,7 @@ function submitMessage() { dataType: 'json', success: onSuccess, error: onError - }); - - updateUI([{ 'nick': Nick, 'content': content}], null); + }); } function ifEnter(fn) { -- cgit v1.2.3-70-g09d2