I have the following question:
When I make a request viaAJAX
and I want to "mount" the HTML
based on data coming from a banco
, it is wrong (in terms of "good practices") to already return HTML
on itself requisition?
Or is it better (as I currently do) to return the data in JSON
and use a template engine in javascript to process this data for DOM
?
(example: underscore.js )
I'm asking this because I've seen that Facebook , in some requests XHR
, returns the HTML already in the request response itself. (and then the question comes up in the head: "If Facebook did, is that right?")