jQuery does not allow doing this out of the box. The best way to achieve this is to use the JSON.stringify method in json2.js found here: http://www.json.org/js.html
This complies with the ECMAScript 5 standard and will use its own methods, if available.
source
share