I want to create an ajax call and get some data (let's say a table with 100 rows). I have 2 ways of doing that:
- Ask the server for a JSON object (and then I will create the table using Javascript)
- Ask the server for the HTML - and then I don't need to do anything on the client.
Is one option is absolutely better then the other? I assume that for huge amount of data it will be best to choose the JSON option. and for really small HTML pieces it will be best to ask for the HTML itself. but I am not sure about that and what to do in the average use-case - what will be the most efficient way.