Properly stringify chat input, so that we wind up with value JSON (doublequote, and others)

This commit is contained in:
Mike Primm 2011-06-02 15:15:46 -05:00
parent d0e66d7e35
commit 7f662b2b1a

View File

@ -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',