I am programming a strange script that consists of transferring variables from client to a nodejs server.
So if a have a date variable, how can I transfer it and use the same variable on the server?
Is there any way to serialize objects and retrieve them on server side in a way that they remain the same type (date, function, variable, string, object…)?
Thank you
You might check out DNode in addition to nowjs. I’ve been watching both of those projects but not dabbled in them yet. However, I get the sense that DNode it is building more traction in the node.js community and I hear praise for it all the time.
https://github.com/substack/dnode
http://substack.net/posts/85e1bd/DNode-Asynchronous-Remote-Method-Invocation-for-Node-js-and-the-Browser
Timezones are very important in my application, so I’ve found that serializing dates to ISO8601 formatted strings for dates works best. @Mike’s solution is great if you don’t care about timezones, or can assume that all dates are UTC. There are plenty of javascript libraries to help serialize/deserialize ISO8601.