[
{ "a" : "1", "b" : "1", "c" : "0" },
{ "a" : "1", "b" : "2", "c" : "1" },
{ "a" : "1", "b" : "3" },
{ "a" : "2", "b" : "1", "c" : "2" },
{ "a" : "2", "b" : "1", "c" : "3" }
]
[{
"a": [{
"1": [{
"b": [{
"1": { "c": "0" },
"2": { "c": "1" },
"3": { "c": "" }
}]
}]
}],
"2": [{
"b": [{
"1": [
{ "c": "2" },
{ "c": "3" }
]
}]
}]
}]
[{
"1": {
"1": "0",
"2": "1",
"3": ""
},
"2": [{
"1": ["2", "3"]
}]
}]
JSON.stringify
и <pre>
на полную.JSON.stringify(jsObj, null, "\t"); // добавит отступы с табами
JSON.stringify(jsObj, null, 4); // добавит отступы с 4 пробелами
<pre>
- адекватно выведет на странице<pre id='formated'></pre>
<script type="text/JavaScript">
var json = JSON.parse('{"glossary":{"title":"example glossary","GlossDiv":{"title":"S","GlossList":{"GlossEntry":{"ID":"SGML","SortAs":"SGML","GlossTerm":"Standard Generalized Markup Language","Acronym":"SGML","Abbrev":"ISO 8879:1986","GlossDef":{"para":"A meta-markup language, used to create markup languages such as DocBook.","GlossSeeAlso":["GML","XML"]},"GlossSee":"markup"}}}}}');
var formated = document.getElementById('formated');
formated.innerHTML = JSON.stringify(json, null, 4);
</script>