back-end or it can receive a
json and format for composition of a view. My answer is based on this assumption.
I will give as an example a simple request containing an array of 2 indexes, only first and last name and formats in JSON , XML and HTML for comparison purposes only.
array( array( 'Papa' , 'Charlie' ) , array( 'Papa' , 'Charlie' ) )
LENGTH : 39
STING : [["Papa","Charlie"],["Papa","Charlie"]]
LENGTH : 191
STING : <usuarios>
LENGTH : 66
STING : <div>Papa</div><div>Charlie</div><div>Papa</div><div>Charlie</div>
Data in JSON is easy to work with type
object , in addition to having a much shorter length than other formats, and this is an interesting point for bandwidth savings. JSON and XML are more flexible and simple to implement webservices, APPs, desktop, mobile devices ...
Some interesting references
• Why is it bad practice to return HTML instead of JSON? Or is it?
AJAX - Using JSON vs. echo HTML
• Why Facebook, Twitter and GMail render all their date to the browser as JSON as opposed to HTML?
• PHP vs. node.js: The REAL statistics
• The AJAX response: XML, HTML, or JSON?
• Creating HTML: PHP server-side vs. jQuery clie