Hi,
I'm developing an app with Node.js and I have this code when I send a message to a server:
Code:
var msg = {
        name: userName,
        text: ABCD
 };
 var json = JSON.stringify({ type:'message', data: msg });
 socket.send(json);
And here the code that receives the message from the server:
Code:
socket.addEventListener("message", function(event) {
     console.log (event.data);
});
Here's what it displays:
Code:

{"type":"message","data":{"name":"userName","text":"ABCD"}}
I wonder if I can get it displayed like this:
Code:
userName
ABCD
I have taken the code from here: http://martinsikora.com/nodejs-and-w...-chat-tutorial
I guess the author have a function that explodes the string and grab the value accordingly, but I don't understand what is that function.

Thanks