diff options
Diffstat (limited to 'static/pichat.js')
| -rwxr-xr-x | static/pichat.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/static/pichat.js b/static/pichat.js index 81882fe..5a40c62 100755 --- a/static/pichat.js +++ b/static/pichat.js @@ -75,8 +75,8 @@ function submitMessage() { $.ajax({ type: 'GET', timeout: 5000, - url: 'msg', - data: { 'content': content }, + url: '/msg', + data: { 'room': Room, 'content': content }, cache: false, dataType: 'json', success: onSuccess, @@ -107,7 +107,7 @@ function delayedScrollToBottom(delay) { } function updateUI(msgs, users) { - if (msgs && msgs.length > 0) { + if (msgs !== null) { var msgStr = $.map(msgs, buildMessageDiv).join(''); var wasScrolledToBottom = isScrolledToBottom($('#messageList')[0]); $('#messageList').append(msgStr); @@ -116,7 +116,7 @@ function updateUI(msgs, users) { delayedScrollToBottom(500); } } - if (users && users.length > 0) { + if (users !== null) { $("#userList").html($.map(users, buildUserDiv).join('')); } } @@ -136,7 +136,8 @@ function refresh() { $.ajax({ type: 'GET', timeout: 5000, - url: 'refresh', + url: '/refresh', + data: { 'room': Room }, cache: false, dataType: 'json', success: onSuccess, |
