Home JAVASCRIPT Serializing to JSON in jQuery
JSON-js – JSON in JavaScript.
To convert an object to JSON, use JSON.stringify:

var json_text = JSON.stringify(your_object, null, 2);

To convert a JSON string to a JS object, use JSON.parse:

var your_object = JSON.parse(json_text);

It was recently recommended by John Resig:

You may also like

Leave a Comment