Does jQuery have a JSON/javascript object to HTML pretty print function similar to PHP's var_dump?

前端 未结 3 1542
日久生厌
日久生厌 2021-02-05 11:44

Does jQuery have a JSON/Javascript object to HTML pretty print function similar to PHP\'s var_dump? If yes, what is it?

3条回答
  •  情深已故
    2021-02-05 12:05

    jQuery does not (out of the box).

    However, James Padolsey created this prettyPrint which I really like.

    Also, if you're using Firebug or Web Inspector (or similar), you can just type the object into the console, press return, and see a tree-dump of the object. To force a tree-view, call console.dir(obj)

提交回复
热议问题