From 61c6f4a086b6e04faf57420d2e9664f4cfca5a9f Mon Sep 17 00:00:00 2001 From: Arthur Mayer Date: Fri, 18 Feb 2011 20:15:18 +0100 Subject: [PATCH 1/2] corrected the json string in sendChat() --- web/chat.js | 16 ++++++++-------- web/map.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/web/chat.js b/web/chat.js index 923fe8cf..e5a89f71 100644 --- a/web/chat.js +++ b/web/chat.js @@ -5,14 +5,14 @@ function sendChat(message) { url: "http://jsonip.appspot.com/?callback=?", dataType: "jsonp", success: function(getip) { - var data = { name: getip.ip, message: message }; - $.ajax({ - type: 'POST', - url: '/up/sendmessage', - data: data, - dataType: 'json', - success: function(response) { - //handle response + var data = '{"name":"'+getip.ip+'","message":"'+message+'"}'; + $.ajax({ + type: 'POST', + url: 'http://prosrv.info:8123/up/sendmessage', + data: data, + dataType: 'json', + success: function(response) { + //handle response } }); } diff --git a/web/map.js b/web/map.js index dd46d92e..0725e4a7 100644 --- a/web/map.js +++ b/web/map.js @@ -210,7 +210,7 @@ DynMap.prototype = { .attr({ id: 'chatinput', type: 'text', - value: 'not working yet' + value: '' }) .keydown(function(event) { if (event.keyCode == '13') { From 9d490cbcc8d1a68e4ac8d0615fe67e0e70a845f0 Mon Sep 17 00:00:00 2001 From: Arthur Mayer Date: Sat, 19 Feb 2011 08:26:40 +0100 Subject: [PATCH 2/2] removed my custom url, made it relative --- web/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/chat.js b/web/chat.js index e5a89f71..ac204d3a 100644 --- a/web/chat.js +++ b/web/chat.js @@ -8,7 +8,7 @@ function sendChat(message) { var data = '{"name":"'+getip.ip+'","message":"'+message+'"}'; $.ajax({ type: 'POST', - url: 'http://prosrv.info:8123/up/sendmessage', + url: '/up/sendmessage', data: data, dataType: 'json', success: function(response) {