JSON.stringify output to div in pretty print way

后端 未结 12 2413
野趣味
野趣味 2020-11-29 18:17

I JSON.stringify a json object by

result = JSON.stringify(message, my_json, 2)

The 2 in the argument above is su

12条回答
  •  盖世英雄少女心
    2020-11-29 18:45

    If this is really for a user, better than just outputting text, you can use a library like this one https://github.com/padolsey/prettyprint.js to output it as an HTML table.

提交回复
热议问题