--

--

Nov 1

To prettify a JSON object on the browser, use the <pre> tag.

var data = {
"data": {
"x": "1",
"y": "1",
"url": "http://url.com"
},
"event": "start",
"show": 1,
"id": 50
}


document.getElementById("json").textContent = JSON.stringify(data, undefined, 2);
<pre id="json"></pre>

pre tells the…

--

--