Here is what I have:
Client Side:
socket.on('PING__',function (data){
console.log(data);
});
socket.emit('__PING');
Server Side:
io.sockets.on('connection', function (socket) {
var connection = socket;
socket.on('__PING', function (data) {
console.log(data);
socket.emit('PING__' , {status:'OK'});
});
});
The console logs out "object {status:'OK'}". If I do this instead on the client:
console.log(data.status);
I get undefined. I don't understand why it isn't logging out the status portion of the JSO. Any help here would be great
Apparently this was a platform-dependent issue. It occurred within Chromium, but not within Firefox. I did this:
console.log($(data)[0].status);
And it worked fine. Yet another reason to use jQuery for cross-platform issues :-/