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

Fletcher Moore picture Fletcher Moore · May 4, 2010 · Viewed 26.9k times · Source

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

Answer

Matt picture Matt · May 4, 2010

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)