开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜