本文介绍了阿贾克斯:定义VS实现? (XML VS JSON VS其他)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AJAX,其实就是异步JavaScript和XML。这个词是派生,因为(我知道的故事),谁开始了这个过程中的第一人通过XML传输的数据从服务器到客户端。最近(也从那时起我一直使用它实际上开始),JSON已经出现,似乎是一个真正的替代品XML。从我的(可能是微薄的)测试和体验,JSON是更小,更容易,更好地传输数据。

AJAX actually means Asynchronous Javascript And XML. This term was derived because (as I know the story) the first people who started this process transferred data from the server to the client via XML. Lately (well ever since I've started using it actually), JSON has been around and appears to be a real alternative to XML. From my (possibly meager) tests and experience, JSON is smaller, easier, and better for transmitting data.

所以我的问题是这样的:这你用交谈,并从服务器/客户端(也可能是为什么)?或者说,什么是你听说过(为什么)最佳做法?

So my question is this: which do you use to talk to and from the server/client (and possibly why)? Or, what are the "best practices" that you have heard of (and why)?

谢谢大家!

推荐答案

JSON与XML似乎是一个正在进行的辩论 - 我宁愿去使用JSON,因为它是一个Web服务更适合的功率混搭和AJAX部件,因为它本质上是序列化Javascript对象(因而很容易与JavaScript才能使用)。

JSON versus XML seems to be an ongoing debate - I'd rather go with JSON since it is a better fit for Web services that power mashups and AJAX widgets because it is essentially serialized Javascript objects (and thus easy to use with Javascript).

您可以找到的优点和JSON的缺点和XML在 JSON或一些广泛的比较XML,哪种格式选择 Ajax响应:?XML ,HTML或JSON?

You can find some extensive comparison of the advantages and disadvantages of JSON and XML on JSON or XML, Which Format to Choose? and The AJAX response: XML, HTML, or JSON?

这篇关于阿贾克斯:定义VS实现? (XML VS JSON VS其他)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 17:12