If you want to safely parse and transmit JSON, you need to use a JSON parser to transfer a text into a Javascript object. To go the other way from a Javascript object to a JSON string you will need to use a JSON stringifier. Be careful on using cyclic data structures, JSON stringifiers don't like them.
2 Comments
In Mozilla bowsers you use myobject.toSource() to get the javascript serialization of the object