I JSON.stringify a json object by
result = JSON.stringify(message, my_json, 2)
The 2 in the argument above is su
A lot of people create very strange responses to these questions that make alot more work than necessary.
The easiest way to do this consists of the following
In actual code, an example will be (combining all steps together):
var input = document.getElementById("input").value;
document.getElementById("output").value = JSON.stringify(JSON.parse(input),undefined,2);
output.value is going to be the area where you will want to display a beautified JSON.