-
1 Attachment(s)
Display formatted JSON
I'm trying to create a page to show some JSON.
Something like this fiddle
I can get the JSON to display in a panel
Code:
<ext:Panel runat="server" Region="Center" Layout="FitLayout" Html="<pre id='someJson'></pre>">
...
document.getElementById("someJson").innerHTML = JSON.stringify(result, undefined, 4);
Attachment 25255
But it not formatted properly.
-
NVM got it.
Just put the pre tag after EXT controls, which works in this instance
Code:
...
</ext:FormPanel>
<pre id="jsond"></pre>
</body>
...
document.getElementById("jsond").innerHTML = JSON.stringify(a, null, 2);