I read that nowjs supports passing objects around as well as just strings, but for some reason I'm having problems with it. This is the nowjs example from their webpage with just a string getting parsed around and working fine for me,
Client Side
now.test('foo', function(msg){
console.log(msg);
});
Server Side
everyone.now.test = function(val, callback){
callback(val + ' bar!');
}
The following code I try to pass and object for the val instead,
Client Side
now.test('default', function(msg){
console.log(Object.keys(msg));
console.log(msg.GetEthernet());
});
Server Side
everyone.now.test = function(val, callback){
var profile = honeydConfig.GetProfile(val);
console.log("Got eth " + profile.GetEthernet() + " for profile " + profileName);
callback(profile);
}
On the server side, it prints the correct output of the GetEthernet function. On the client side it just says, "Uncaught TypeError: Object # has no method 'GetEthernet'" and returns an empty array for Object.keys".