<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ajax Plus - Tips and tutorial for Ajax &#187; Add new tag</title>
	<atom:link href="http://www.ajaxplus.net/tag/add-new-tag/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxplus.net</link>
	<description>All you need to know about Ajax</description>
	<lastBuildDate>Wed, 03 Feb 2010 12:17:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ajax tip: Use JSON format</title>
		<link>http://www.ajaxplus.net/2010/02/03/ajax-tip-use-json-format/</link>
		<comments>http://www.ajaxplus.net/2010/02/03/ajax-tip-use-json-format/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 12:17:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax Tools]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://www.ajaxplus.net/?p=17</guid>
		<description><![CDATA[  Hi all,
The benefit of JSON on other formats is that it is recognized natively by JavaScript. This is huge advantage because you don&#8217;t need to write a code for parsing an XML document to extract the data and get it throught the net. So it saves time and it is faster.
The JSON format is [...] ]]></description>
			<content:encoded><![CDATA[<p> Hi all,</p>
<p>The benefit of <a class="zem_slink" title="JSON" rel="homepage" href="http://json.org">JSON</a> on other formats is that it is recognized natively by JavaScript. This is huge advantage because you don&#8217;t need to write a code for parsing an XML document to extract the data and get it throught the net. So it saves time and it is faster.</p>
<p>The JSON format is very simple:</p>
<pre>{
  "menu": "File",
  "commands": [
      {
          "title": "New",
          "action":"CreateDoc"
      },
      {
          "title": "Open",
          "action": "OpenDoc"
      },
      {
          "title": "Close",
          "action": "CloseDoc"
      }
   ]
}

and you use the eval() JavaScript function to  parse it.
<pre>var req = new XMLHttpRequest();
req.open("GET", "file.json", true);
req.onreadystatechange = myCode;   // the handler
req.send(null);</pre>
<p><strong>The JavaScript handler:</strong></p>
<pre>function myCode()
{
   if (req.readyState == 4)
   {
        var doc = eval('(' + req.responseText + ')');
   }
}
</pre>
</pre>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=e58d1985-08a8-4a14-a289-0d6958b92cf5" alt="" /><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxplus.net/2010/02/03/ajax-tip-use-json-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
