In my project i use Ajax and get response from server.Now I have two option
a) At server create Html from the data and sends to browser
b) Directly sends data at browser in Json Format and create Html at browser.
which one is more efficient
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no significant difference. JSON could be a little slower because it has to encode the data from an array, but I usually use JSON because I often send extra data with AJAX answers.
On Client side JSON needs to get converted to HTML of course but that doesn’t cause much lag.