News for hackers. Stuff that matters.
Re:Open-source, JavaScript JSON HTML viewer released by nirmal on Sunday March 20, 2011 @03:10PM (#2347045)
When I first started interacting with APIs that use JSON I wanted a JS library to automatically convert a JSON structure into, hopefully semantically correct, HTML which I could then easily style with CSS. At the time I couldn't find anything but I did write a simple piece of JS. I show an example of how I used it to style tweets on my site: http://nirmalpatel.com/json2posh/
Re:Open-source, JavaScript JSON HTML viewer released by mcantelon on Sunday March 20, 2011 @01:32PM (#2346776)
Another Javascript-driven JSON viewer (that also allows editing):

http://www.thomasfrank.se/json_editor.html

Re:Open-source, JavaScript JSON HTML viewer released by beaumartinez on Sunday March 20, 2011 @02:17PM (#2346886)
My go-to JSON viewer: http://jsonviewer.stack.hu/
Re:Open-source, JavaScript JSON HTML viewer released by mattezell on Sunday March 20, 2011 @02:51PM (#2346970)
Very nice. I am writing a couchapp and think this will work nicely as a report-generator. Thanks!
Re:Open-source, JavaScript JSON HTML viewer released by mythz on Sunday March 20, 2011 @04:13PM (#2347267)
You're welcome :)
Re:Open-source, JavaScript JSON HTML viewer released by moderation on Sunday March 20, 2011 @04:11PM (#2347260)
Re:Open-source, JavaScript JSON HTML viewer released by irfn on Monday March 21, 2011 @02:47AM (#2348753)
that is different thing altogether. You are comparing apples and Oranges.
Re:Open-source, JavaScript JSON HTML viewer released by y0ghur7_xxx on Sunday March 20, 2011 @03:41PM (#2347150)
How is this different from all the javascript template engines like ejs[1], jQuery.tmpl(), jQuote2[2] or one of the many others?

[1]http://embeddedjs.com/

[2]http://aefxx.com/jquery-plugins/jqote2/

edit: Now I understand. This one generates the report automagically, no need to create a HTML template for the JSON data.

Re:Open-source, JavaScript JSON HTML viewer released by mythz on Sunday March 20, 2011 @04:05PM (#2347235)
Yeah, it's just a way to better visualize your JSON data so it becomes more readable in a glance.
Re:Open-source, JavaScript JSON HTML viewer released by regularfry on Sunday March 20, 2011 @04:12PM (#2347262)
Is there a JSON microformat for marking strings as URLs which the user agent should be able to follow? 'Cos that's all that's missing from making this sort of thing a generic REST client.
Re:Open-source, JavaScript JSON HTML viewer released by mythz on Sunday March 20, 2011 @04:27PM (#2347304)
I think it's rare to see JSON HyperMedia data formats in the wild, XML seems the preferred choice due to its use of attributes for metadata annotation.

Here's on of the few examples I've found that uses JSON: http://restafari.blogspot.com/2010/10/evolving-hal.html

Re:Open-source, JavaScript JSON HTML viewer released by mythz on Sunday March 20, 2011 @04:29PM (#2347310)
Although I dislike the use of XML in Ajax/SPA applications and very much side with Douglas Crockford in the JSON vs XML debate :) http://www.infoq.com/presentations/Heretical-Open-Source
Re:Open-source, JavaScript JSON HTML viewer released by apu on Sunday March 20, 2011 @08:39PM (#2347890)
Perhaps you could do some simple detection if a given field is a url (i.e., using a regexp) and auto-link it in the generated reports?
Re:Open-source, JavaScript JSON HTML viewer released by regularfry on Monday March 21, 2011 @02:58AM (#2348776)
That won't work reliably with relative links. It also lacks any kind of link annotation (so, is this linked resource a "parent"? A "child"? Metadata? And so on).
Re:Open-source, JavaScript JSON HTML viewer released by regularfry on Monday March 21, 2011 @04:05AM (#2348865)
There's also this: http://microformats.org/wiki/rest/json which looks interesting enough to bookmark.
Re:Open-source, JavaScript JSON HTML viewer released by vivekjishtu on Sunday March 20, 2011 @10:19PM (#2348121)
There is a bug while parsing http://reddit.com/.json It is unable to render it.
Re:Open-source, JavaScript JSON HTML viewer released by mythz on Monday March 21, 2011 @07:18PM (#2352095)
Ok, fixed a null ref bug. http://reddit.com/.json now works, just a little ugly
Re:Open-source, JavaScript JSON HTML viewer released by jrockway on Sunday March 20, 2011 @11:40PM (#2348345)
I couldn't even get it to accept:

{"OH HAI":[{"foo":42, "bar":123}, {"foo":123, "bar":456}]}

Re:Open-source, JavaScript JSON HTML viewer released by thwarted on Monday March 21, 2011 @12:47AM (#2348518)
This:

    {"foo":42, "bar",123}
isn't even a valid JSON object. If you make it valid JSON and replace the comma in this with a colon, it accepts it.
Re:Open-source, JavaScript JSON HTML viewer released by jrockway on Monday March 21, 2011 @01:15AM (#2348574)
That was an HN typo, as I had already closed the window where I typed the JSON.
Re:Open-source, JavaScript JSON HTML viewer released by smarterchild on Monday March 21, 2011 @11:37AM (#2350165)
I've used/loved http://chris.photobooks.com/json/default.htm since the beginning of time for debugging. It isn't embeddable, though I find that it's more readable.
Re:Open-source, JavaScript JSON HTML viewer released by irfn on Monday March 21, 2011 @02:50AM (#2348757)
Awesome piece of work! I am definitely gonna use this when i get a chance.