开发者

How do I display a JSON object in a pretty format , on my webpage? [duplicate]

开发者 https://www.devze.com 2023-03-22 04:45 出处:网络
This question already has answers here: Closed 10 years ago. 开发者_运维百科 Possible Duplicate: JavaScript data formatting/pretty printer
This question already has answers here: Closed 10 years ago. 开发者_运维百科

Possible Duplicate:

JavaScript data formatting/pretty printer

var theobject_string = '{...}'; // I have a json object as a string.

How can I display this string in a pretty way, on my webpage (html)?

I want this the elements to be indented.


This library does exactly what you're looking for: http://www.cerny-online.com/cerny.js/demos/json-pretty-printing

0

精彩评论

暂无评论...
验证码 换一张
取 消