How do I display a JSON object in a pretty format , on my webpage? [duplicate]
Possible Duplicate:
JavaScript data formatting/pretty printer
var theobject_string = '{...}'; // I have a json object as a string.
How can I display this string in a pretty way, on my webpage (html)?
I want this the elements to be indented.
This library does exactly what you're looking for: http://www.cerny-online.com/cerny.js/demos/json-pretty-printing
精彩评论