AJAX Response : String or XML?

Romit Bose

Ranch Hand

Posts: 50

posted 9 years ago

hi all, greetings, i am doing some work with AJAX where i need to pass some data from the client to the servlet and in return the server response will contain some data from a table.Now, the data may comprise of multiple rows, so, i need to decide upon how to pass the data. would it be better if i contructed a delimited string and passed it as a response, or should it be an XML that i must construct on the server side and parse back the data on the client? By better i mean performance and of course, the right way of doing it. Thanks!

Eric Pascarello

author
Rancher

Posts: 15385

6

posted 9 years ago

JSON is the preferred method.

Eric

Romit Bose

Ranch Hand

Posts: 50

posted 9 years ago

hi Eric, JSON.... i must admit that i am really a greenhorn in javascript and i heard the term for the first time, so, can you please elaborate a little on that?