Take the 2-minute tour ×

I am using Jquery in my J2EE application. I am still using XML to get pass and get the data from the server. My client side code is very vague to see. Is it better to move from XML to JSON ?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

There have been big discussions about XML vs. JSON. Speaking in performance, there is actually no way around JSON. Its just so well recognized by JavaScript. Parsing & Encoding is way way faster than XML.

Still, there is a right to exist for XML. If you got very large datastructures with lots of information for instance, XML might be a better choice.

So I think it really depends on what kind of data structure you want to transfer, but in general, I'd always prefer JSON for server->client (javascript) data transfer.

Further read: http://stackoverflow.com/questions/325085/when-to-prefer-json-over-xml

share|improve this answer

Your Answer


