I know to use eval() to parse JSON to an object, but how do I parse an object to JSON format using JavaScript?
Thanks.
I know to use eval() to parse JSON to an object, but how do I parse an object to JSON format using JavaScript?
Thanks.
The newer browsers support JSON.stringify. You can also download and include it yourself.
var json = JSON.stringify(yourObject);
Afaik jQuery does not provide such a method.
JSON also provides the JSON.parse method. It is described on the site I linked to.