Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Thread: Why so much JSON hype?
02-19-2007, 05:07 AM #1
- Join Date
- Dec 2006
- Thanked 1 Time in 1 Post
Why so much JSON hype?
John Resig posted his RSS to JSON converter here:
My question is: why is everyone going crazy over JSON?
RSS/XML is great -- why replace it with JSON? What has JSON got that XML hasn't?
(ie. what are the advantages of JSON over XML for the web developer?)
02-19-2007, 08:18 AM #2
02-19-2007, 09:37 AM #3
JSON is more domain-specific than XML, and by virtue of that may be better suited for simple data transactions via XMLHttpRequest() than XML. Given that XMLHttpRequest is almost never used to specifically request an XML document (why would you grab an SVG document and import it that way when you could just as easily load it in an iframe?), it makes sense use a better-suited but more limited data-format.
Also, for "AJAX"-related work, in my own library, I send JS objects out, so it makes sense for me to receive JS objects back, rather than an XML document. (Constructing an XML document to send out is more expensive/more difficult than constructing a JS object, explaining my choice.)