JavaScript Object Notation (JSON) (1) Part of an example of JSON from by Peter-Paul Koch. ----8<---- {"books":[{"book": { "title":"JavaScript, the Definitive Guide", "publisher":"O'Reilly", "author":"David Flanagan", "cover":"/images/cover_defguide.jpg", "blurb":"Lorem ipsum dolor sit amet, consectetuer adipiscing elit." } }, {"book": { "title":"DHTML Utopia: Modern Web Design using JavaScript & DOM", "publisher":"Sitepoint", "author":"Stuart Langridge", "cover":"/images/cover_utopia.jpg", "blurb":"Lorem ipsum dolor sit amet, consectetuer adipiscing elit." } } ]} ---->8---- (2) See for a short movie about how easy this can be to use. Primary advantages: - less typing - bypasses cross-domain code restrictions - execution time is shorter than other techniques on current (2007) platforms - flatter (fewer protocol layers) than many alternatives Disadvantages/Issues: - data-centric as opposed to document-centric (like XML) - much more susceptible to Trojan horse attacks than any other techniques Note: - defined in RFC 4627, syntax diagrams at - `The sweet spot for JSON is serializing simple data structures for transfer between programming languages. If you need more complex data structures (maybe with some kind of schema for validation), use XML. If you want to do full blown RPC use SOAP or XML-RPC. If you just want a light-weight format for moving data around, JSON fits the bill admirably.' -- Simon Willison