Similar Question:
JSON pretty print using JavaScript
I am looking to present my raw JSON data on an HTML page similar to how JSONView displays it. Here is an example of my raw JSON data:
{
"hey":"guy",
"anumber":243,
"anobject":{
"whoa":"nuts",
"anarray":[
1,
2,
"thr<h1>ee"
],
"more":"stuff"
},
"awesome":true,
"bogus":false,
"meaning":null,
"japanese":"明日がある。",
"link":"http://jsonview.com",
"notLink":"http://jsonview.com is great"
}
This data is sourced from . What I aim to accomplish is similar to when using Chrome with the JSONView plugin installed.
I have attempted to understand the process but have not succeeded. I am looking to use a JavaScript script (with CSS for formatting) to customize the display of my raw JSON data retrieved via AJAX and then place it on an HTML page within a specified element like a div. Are there any JavaScript libraries available to achieve this task, or could you provide guidance on how to achieve this?