📜  在 html 代码示例中显示带有缩进的对象

📅  最后修改于: 2022-03-11 14:53:12.308000             🧑  作者: Mango

代码示例1
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);

//