Ajax 应该变成 Ajaj (关于JSON 与 XML 的比较)

<span style="font-family: Times New Roman; font-size: 18px;">1、可读性 </span>

<span style="font-family: Times New Roman; font-size: 18px;"> JSON和XML的可读性可谓不相上下,一边是建议的语法,一边是规范的标签形式,很难分出胜负。</span>

<span style="font-family: Times New Roman; font-size: 18px;">2、可扩展性</span>

<span style="font-family: Times New Roman; font-size: 18px;">XML天生有很好的扩展性,JSON当然也有,没有什么是XML能扩展,JSON不能的。<br>
3、编码难度</span>

<span style="font-family: Times New Roman; font-size: 18px;"> XML有丰富的编码工具,比如Dom4j、JDom等,JSON也有json.org提供的工具,但是JSON的编码明显比XML容易许多,即使不借助工具也能写出JSON的代码,可是要写好XML就不太容易了。</span>

<span style="font-family: Times New Roman; font-size: 18px;">4、解码难度</span>

<span style="font-family: Times New Roman; font-size: 18px;">XML的解析得考虑子节点父节点,让人头昏眼花,而JSON的解析难度几乎为0。这一点XML输的真是没话说。</span>

<span style="font-family: Times New Roman; font-size: 18px;">5、流行度</span>

<span style="font-family: Times New Roman; font-size: 18px;"> XML已经被业界广泛的使用,而JSON才刚刚开始,但是在</span>[url=http://www.qqread.com/z/web/ajax/z.html]<span style="font-family: Times New Roman; font-size: 18px;">Ajax</span>[/url]<span style="font-family: Times New Roman; font-size: 18px;">这个特定的领域,未来的发展一定是XML让位于JSON。到时Ajax应该变成Ajaj
(Asynchronous</span>[url=http://www.qqread.com/keywords/%20.html]<span style="font-family: Times New Roman; font-size: 18px;">JavaScript</span>[/url]<span style="font-family: Times New Roman; font-size: 18px;"> and JSON)了。</span>

<span style="font-family: Times New Roman; font-size: 18px;">6、XML与JSON的写法</span>

<span style="font-family: Times New Roman; font-size: 18px;">XML写法:</span>

<span style="font-family: Times New Roman; font-size: 18px;"><contact></span>

<span style="font-family: Times New Roman; font-size: 18px;"> <friend></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <name>Michael</name></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <email>17bity@gmail.com</email></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <homepage>http://www.jialing.net</homepage></span>

<span style="font-family: Times New Roman; font-size: 18px;"> </friend></span>

<span style="font-family: Times New Roman; font-size: 18px;"> <friend></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <name>John</name></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <email>john@gmail.com</email></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <homepage>http://www.john.com</homepage></span>

<span style="font-family: Times New Roman; font-size: 18px;"> </friend></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <friend></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <name>Peggy</name></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <email>peggy@gmail.com</email></span>

<span style="font-family: Times New Roman; font-size: 18px;">  <homepage>http://www.peggy.com</homepage></span>

<span style="font-family: Times New Roman; font-size: 18px;"> </friend></span>

<span style="font-family: Times New Roman; font-size: 18px;"></contact></span>

<span style="font-family: Times New Roman; font-size: 18px;">JSON写法:[</span>

<span style="font-family: Times New Roman; font-size: 18px;">{</span>

<span style="font-family: Times New Roman; font-size: 18px;"> name:"Michael",</span>

<span style="font-family: Times New Roman; font-size: 18px;"> email:"17bity@gmail.com",</span>

<span style="font-family: Times New Roman; font-size: 18px;"> homepage:"http://www.jialing.net"</span>

<span style="font-family: Times New Roman; font-size: 18px;">},</span>

<span style="font-family: Times New Roman; font-size: 18px;">{</span>

<span style="font-family: Times New Roman; font-size: 18px;"> name:"John",</span>

<span style="font-family: Times New Roman; font-size: 18px;"> email:"john@gmail.com",</span>

<span style="font-family: Times New Roman; font-size: 18px;"> homepage:"http://www.jobn.com"</span>

<span style="font-family: Times New Roman; font-size: 18px;">},</span>

<span style="font-family: Times New Roman; font-size: 18px;">{</span>

<span style="font-family: Times New Roman; font-size: 18px;"> name:"Peggy",</span>

<span style="font-family: Times New Roman; font-size: 18px;"> email:"peggy@gmail.com",</span>

<span style="font-family: Times New Roman; font-size: 18px;"> homepage:"http://www.peggy.com"</span>

<span style="font-family: Times New Roman; font-size: 18px;">}</span>

<span style="font-family: Times New Roman; font-size: 18px;">]</span>

<span style="font-family: Times New Roman; font-size: 18px;"></span>

<span style="font-family: Times New Roman; font-size: 18px;"></span>

<span style="font-family: Times New Roman; font-size: 18px;"></span>

<span style="font-family: Times New Roman; font-size: 18px;"> </span>

<span style="font-family: Times New Roman; font-size: 18px;"></span>

<span style="font-family: Times New Roman; font-size: 18px;"></span>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值