I JSON.stringify a json object by
result = JSON.stringify(message, my_json, 2)
The 2 in the argument above is su
My proposal is based on:
var x = { "data": { "x": "1", "y": "1", "url": "http://url.com" }, "event": "start", "show": 1, "id": 50 };
document.querySelector('#newquote').innerHTML = JSON.stringify(x, null, 6)
.replace(/\n( *)/g, function (match, p1) {
return '
' + ' '.repeat(p1.length);
});