Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>JSON ( Javascript Object Notation ) is more often used than XML because it is lightweight, and native Javascript.</p> <p>That being said, if what you need is XML, then you would pull back XML.</p> <p>Here's a good page on <a href="http://www.subbu.org/blog/2006/08/json-vs-xml" rel="nofollow noreferrer">when to use HTML, XML or JSON</a></p> <p>Here's a <a href="http://balaarjunan.wordpress.com/2007/03/20/json-a-brief-sketch-and-json-vs-xml/" rel="nofollow noreferrer">good page on the differences</a> between the two.</p> <p>JSON is used for performance reasons, mostly. To use <strong>the example from that page</strong>:</p> <p>XML:</p> <pre><code>&lt;?xml version=’1.0′ encoding=’UTF-8′?&gt; &lt;card&gt; &lt;fullname&gt;Bala Arjunan&lt;/fullname&gt; &lt;org&gt;PH&lt;/org&gt; &lt;emailaddrs&gt; &lt;address type=’work’&gt;abcd@xyz.com&lt;/address&gt; &lt;address type=’home’ pref=’1′&gt;me@mailme.com&lt;/address&gt; &lt;/emailaddrs&gt; &lt;telephones&gt; &lt;tel type=’work’ pref=’1′&gt;+12345678&lt;/tel&gt; &lt;tel type=’mobile’&gt;+1234 1234&lt;/tel&gt; &lt;/telephones&gt; &lt;addresses&gt; &lt;address type=’work’ format=’B'&gt;1234 Oil Mill St Chennai, IND&lt;/address&gt; &lt;address type=’home’ format=’B'&gt;5678 Oil Mill St Chennai, IND&lt;/address&gt; &lt;/addresses&gt; &lt;urls&gt; &lt;address type=’work’&gt;http://balaarjunan.wordpress.com/&lt;/address&gt; &lt;address type=’home’&gt;http://balaarjunan.wordpress.com/&lt;/address&gt; &lt;/urls&gt; &lt;/card&gt; </code></pre> <p>JSON:</p> <pre><code>{ “fullname”: “Bala Arjunan”, “org”: “PH”, “emailaddrs”: [ {"type": "work", "value": "abcd@xyz.com"}, {"type": "home", "pref": 1, "value": "me@mailme.com"} ], “telephones”: [ {"type": "work", "pref": 1, "value": "+12345678"}, {"type": "mobile", "value": "+1234 1234"} ], “addresses”: [ {"type": "work", "format": "us", "value": "1234 Oil Mill St Chennai, IND"}, {"type": "home", "format": "us", "5678 Oil Mill St Chennai, IND"} ], “urls”: [ {"type": "work", "value": "http://balaarjunan.wordpress.com/"}, {"type": "home", "value": "http://balaarjunan.wordpress.com/"} ] } </code></pre> <p>With JSON, there is far less redundancy.</p> <p>OTOH, sending plain ol' HTML is very effective at times as well. You have to think about your data. If you're just updating a paragraph of text, just send html through. IF you're dealing with items, or a collection of items that you're going to manipulate or use somehow in Javascript, you want JSON. If you want to ASyncronously update your RSS Feed or some other XML, you ask for XML. </p> <p>Remember, HTML is just a subset of XML. and xHTML follows all the xml rules. Browsers that are javascript aware ( all of them ) can understand JSON ( Javascript ) and HTML (XML). Choose what fits your project based on how you will use the data.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload