Hi Samuel,
Why one page applications for example, transforming the JSON client side is
a must?
For one-page-application, it is still feasible to have XHR response as HTML
partials.
Thanks,
-Morgan
On Sat, Sep 10, 2011 at 9:54 PM, Samuel Richardson s...@richardson.co.nzwrote:
There's a lot
2011/9/11 Mo Cheng morgan.chen...@gmail.com:
JSON might be more flexible. But, is HTML really more complex?
Having related data as attribute started with data- is common practice to
bind data to HTML
div data-id=xxx data-foo=xxx
...
/div
It is common, but parsing the DOM for some value
In my opinion, there are several advantages on using JSON and render
it client-side
- Payload: JSON is way smaller than HTML. Specially important if you
are going to be browsed through a 3G connection.
- Server optimization: usually, the server can render JSON faster than
HTML (not in all cases,