admin管理员组

文章数量:1304960

Just a quick question (it's marked as a munity wiki)

From experiences, have you found it easier to evaluate your ajax responses using XML or JSON when using ExtJS? Which format is ExtJs better for handling?

I'm torn between them.

Thanks!

Just a quick question (it's marked as a munity wiki)

From experiences, have you found it easier to evaluate your ajax responses using XML or JSON when using ExtJS? Which format is ExtJs better for handling?

I'm torn between them.

Thanks!

Share Improve this question asked May 28, 2010 at 14:40 munity wiki
Flukey 1
  • SO and polls don't mix so well, but I'd vote JSON and it's not even close. – annakata Commented May 28, 2010 at 15:15
Add a ment  | 

4 Answers 4

Reset to default 9

According to the ExtJS team, JSON is easier and faster to use.

In my former job, we tried both and definitely had better performance with JSON.

JSON, since javascript can handle this natively you don't have to use any extra libs etc for parsing it.

JSON is definitely the way to go if you can produce it efficiently on the server-side (which usually isn't a problem for most languages).

If you are dealing with big datasets and need to find data within that set quick and easy, XML would probably be faster because it would parse it natively, and using native xpath-support it would probably find your data blazing fast.

Using JSON in those cases would require an eval on the data, and most json-parsers also validates a lot of the code for security reasons etc meaning that it wont be exclusively "native" code that processes it.

That will make a huge impact on the total processing time which would be a lot of overhead if you would only use a small sample in the data.

Both techniques has pros and cons, so it's more dependent on the actual case it will be used in.

本文标签: javascriptExtJSDo you find it easier to work with JSON or XML responsesStack Overflow