diff --git a/web/js/chat.js b/web/js/chat.js index 8e29bc00..3fca24e1 100644 --- a/web/js/chat.js +++ b/web/js/chat.js @@ -21,7 +21,7 @@ componentconstructors['chat'] = function(dynmap, configuration) { if (dynmap.options.allowwebchat) { // Accepts 'sendchat'-events to send chat messages to the server. $(dynmap).bind('sendchat', function(event, message) { - var data = '{"name":"'+ip+'","message":"'+message+'"}'; + var data = '{"name":'+JSON.stringify(ip)+',"message":'+JSON.stringify(message)+'}'; $.ajax({ type: 'POST', url: 'up/sendmessage',