<?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>Pressing the Red Button &#187; JSON</title>
	<atom:link href="http://www.pressthered.com/tag/json/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pressthered.com</link>
	<description>Adventures in Software Development</description>
	<lastBuildDate>Sun, 05 Sep 2010 16:55:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Navigating a JSON object in Javascript</title>
		<link>http://www.pressthered.com/navigating_a_json_object_in_javascript/</link>
		<comments>http://www.pressthered.com/navigating_a_json_object_in_javascript/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 06:29:32 +0000</pubDate>
		<dc:creator>jim.richmond</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://www.pressthered.com/?p=353</guid>
		<description><![CDATA[The Scenario:
You are working with a web service that returns JSON. You&#8217;ve used your javascript library to convert the string into a JSON object. Now you need to access the data in the object using javascript. Here are some examples:
JSON Property Types
The properties of a JSON object are going to be of the following types: [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The Scenario:</strong><br />
You are working with a web service that returns JSON. You&#8217;ve used your <a href="http://www.json.org/js.html">javascript library</a> to convert the string into a JSON object. Now you need to access the data in the object using javascript. Here are some examples:</p>
<p><strong>JSON Property Types</strong><br />
The properties of a JSON object are going to be of the following types: another Object or an Array of Objects. Objects are name &#8211; value pairs. The value that is returned can be a string, a number, another object, an array, true, false, or null.</p>
<p><strong>Accessing an Object type in JSON:</strong></p>
<pre name="code" class="javascript">
//A Simple Example:
// Your JSON object(yourData) has a name property,
//  you could get it this way:
var name = yourData.Name;
// alternatively you can use a string index:
var name = yourData["Name"];

//A Nested Example
// Your JSON object(yourData) has a Books object
//  with nested Book objects
var books = yourData.Books;
for (var x in books)
{
 var book = books[x];
 var title = book.title;
}
</pre>
<p><strong>Accessing an Array type in JSON:</strong></p>
<pre name="code" class="javascript">
//A Nested Example with an Array
// Your JSON object(yourData) has a
// Books array with nested Book objects
var books = yourData.Books;
for (var x = 0; x++; x< books.length)
{
 var book = books[x];
 var title = book.title;
}
</pre>
<p><strong>Getting Property Names</strong></p>
<pre name="code" class="javascript">
// When you want to know the name of the
//  properties of an object you can iterate
//  through the object using for - in loop
var books = yourData.Books;
for (var x in books)
{
 alert(x);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pressthered.com/navigating_a_json_object_in_javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View, Browse, and Edit JSON Objects Visually</title>
		<link>http://www.pressthered.com/view_browse_and_edit_json_objects_visually/</link>
		<comments>http://www.pressthered.com/view_browse_and_edit_json_objects_visually/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 05:52:01 +0000</pubDate>
		<dc:creator>jim.richmond</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://www.pressthered.com/?p=272</guid>
		<description><![CDATA[Here are some helper applications that let you view, browse and edit JSON objects. When I am first working with a web service that returns JSON, I like a quick overview of what it includes. Having a navigable treeview helps find the properties that you need and get them quickly integrated into your code.
Here they [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some helper applications that let you view, browse and edit JSON objects. When I am first working with a web service that returns JSON, I like a quick overview of what it includes. Having a navigable treeview helps find the properties that you need and get them quickly integrated into your code.</p>
<p><strong>Here they are:</strong></p>
<p><strong><a href="http://www.thomasfrank.se/json_editor.html">My JSON Editor</a> with <a href="http://www.thomasfrank.se/downloadableJS/JSONeditor_example.html">Demo</a></strong><br />
I like this one because it is simple and easy to use. You paste in your json string, click save and it gives you a quick tree view of your object.<br />
<div id="attachment_274" class="wp-caption aligncenter" style="width: 310px"><img src="http://www.pressthered.com/wp-content/uploads/2009/06/json1-300x164.gif" alt="My JSON Editor" title="My JSON Editor" width="300" height="164" class="size-medium wp-image-274" /><p class="wp-caption-text">My JSON Editor</p></div></p>
<p><strong><a href="http://jsoneditor.appspot.com/">JSON Editor</a></strong><br />
This one works too.<br />
<div id="attachment_273" class="wp-caption aligncenter" style="width: 310px"><img src="http://www.pressthered.com/wp-content/uploads/2009/06/json2-300x79.gif" alt="JSON Editor" title="JSON Editor" width="300" height="79" class="size-medium wp-image-273" /><p class="wp-caption-text">JSON Editor</p></div></p>
<p><strong><a href="http://www.softwareishard.com/blog/firebug/json-explorer-for-firebug/">Firebug JSON Explorer</a></strong><br />
I actually havn&#8217;t it tried this one, but it was definitely worth mentioning. I use Firebug but this feature is only available in the 1.4 beta. I wasn&#8217;t feeling brave enough to upgrade my Firebug version at the time of writing.</p>
<p><strong>What would be nice to see&#8230;</strong><br />
I would want to click on an element in the tree view and get the fully qualified javascript code to read the value. Save me some typing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pressthered.com/view_browse_and_edit_json_objects_visually/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
