Re: [JSMentors] Should XmlHttpRequest Response Be HTML or JSON?

2011-09-11 Thread Mo Cheng
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

Re: [JSMentors] Should XmlHttpRequest Response Be HTML or JSON?

2011-09-11 Thread Poetro
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

Re: [JSMentors] Should XmlHttpRequest Response Be HTML or JSON?

2011-09-11 Thread Sergio Cinos
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,