pretty-print JSON using JavaScript

后端 未结 24 1757
一向
一向 2020-11-21 06:45

How can I display JSON in an easy-to-read (for human readers) format? I\'m looking primarily for indentation and whitespace, with perhaps even colors / font-styles / etc.

24条回答
  •  闹比i
    闹比i (楼主)
    2020-11-21 06:58

    Better way.

    Prettify JSON Array in Javascript

    JSON.stringify(jsonobj,null,'\t')
    

提交回复
热议问题