I have a large JSON object that I created with Python, and I\'m needing to display the information on a webpage now. My problem is the size of it; there are nested arrays an
You could use a JS templating engine to transform your JSON to a humanly readable HTML.
Here is an example of recursion with the PURE templating lib: http://beebole.com/pure/documentation/recursion-example/
The template here is quite generic, using a UL/LI
combination.
Or if you want to render it for instance in a textbox you can use JSON.stringify
:
document.getElementById('theTextBox').value = JSON.stringify(theJson, null, 2);
The call above to stringify
will indent the JSON with 2 spaces.