Code Snippet - Sample Code for Beautify Json

5/2/2015·1 min read
Responsive image
Photo by AltumCode on Unsplash
<div id="test"></div>
<style>
    #test { white-space: pre; font-family: monospace; }
</style>
<script>
    var qobj = @Html.Raw(JsonConvert.SerializeObject(Model.SomeKindOfObject));
    document.getElementById("test").innerHTML = JSON.stringify(qobj, null, 4);
</script>