Similar Question:
JavaScript data formatting/pretty printer
var theobject_string = '{...}'; // I have a JSON object as a string.
Is there a way to present this string in a visually appealing manner on an HTML webpage?
I would like the elements to be properly indented for better readability.