最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ExtJS - Do you find it easier to work with JSON or XML responses? - Stack Overflow

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论