Prevent broken JSON when http://jsonip.appspot.com/ is over quote or

broken.
This commit is contained in:
Mike Primm 2011-06-12 21:33:36 -07:00
parent a827843365
commit f802c1d889
1 changed files with 1 additions and 1 deletions

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":'+JSON.stringify(ip)+',"message":'+JSON.stringify(message)+'}';
var data = '{"name":'+JSON.stringify(ip?ip:"")+',"message":'+JSON.stringify(message)+'}';
$.ajax({
type: 'POST',
url: config.url.sendmessage,