<?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>Latent Motion &#187; delicious</title>
	<atom:link href="http://www.latentmotion.com/tag/delicious/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.latentmotion.com</link>
	<description>Usability, Design and Front-Side Programming</description>
	<lastBuildDate>Tue, 27 Jul 2010 05:40:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Calling Remote JSON Files via Javascript / jQuery</title>
		<link>http://www.latentmotion.com/calling-remote-json-files-via-javascript-jquery/</link>
		<comments>http://www.latentmotion.com/calling-remote-json-files-via-javascript-jquery/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 16:00:10 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[data feeds]]></category>
		<category><![CDATA[delicious]]></category>
		<category><![CDATA[getjson]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.latentmotion.com/?p=310</guid>
		<description><![CDATA[Not too long ago, I was asked to create a rolling delicious feed using their JSON data. It took me quite a while to realize what was going wrong &#8211; but the solution was obvious as soon as the problem became clear. If you&#8217;re going down the same path, maybe this bit of advice will [...]]]></description>
			<content:encoded><![CDATA[<p>Not too long ago, I was asked to create a rolling delicious feed using their JSON data. It took me quite a while to realize what was going wrong &#8211; but the solution was obvious as soon as the problem became clear. If you&#8217;re going down the same path, maybe this bit of advice will help.</p>
<p>Firstly, you have to create a local reference of the JSON data. As I understand it, this has to do with the <a href="http://en.wikipedia.org/wiki/JSON#Security_issues">JSON server settings and security</a>. In any event, it&#8217;s easy enough to do. Create a file, such as my delicious-json.php. All you need to put in it is this:</p>
<pre><pre class="brush: php;">

&lt;?php
echo file_get_contents(&quot;http://feeds.delicious.com/v2/json/tag/hyperstudio&quot;);
?&gt;

</pre></pre>
<p>Easy peasy. Now you can reference it via jQuery, like so:</p>
<pre><pre class="brush: jscript;">
&lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'&gt;&lt;/script&gt;
$(document).ready(function(){
// DELICIOUS JSON -- http://feeds.delicious.com/v2/json/tag/hyperstudio
  $.getJSON('delicious-json.php', function(data){
    $.each(data, function(i, entry) {
      // Process your data here
    });
  });
});
</pre></pre>
<p>How you use the JSON is up to you. In tomorrow&#8217;s post, I&#8217;ll describe my preferred method &#8211; cloning a model. Doing so has a lot of speed benefits, but more importantly, it separates the html from the javascript. As a consequence, any web designer can easily step in and modify the aesthetics without touching code. This facilitates the very important separation of concerns.</p>




	<a rel="nofollow" class="digg" target="_blank" href="javascript:window.location='http%3A%2F%2Fdigg.com%2Fsubmit%3Fphase%3D2%26amp%3Burl%3Dhttp%253A%252F%252Fwww.latentmotion.com%252Fcalling-remote-json-files-via-javascript-jquery%252F%26amp%3Btitle%3DCalling%2520Remote%2520JSON%2520Files%2520via%2520Javascript%2520%252F%2520jQuery%26amp%3Bbodytext%3DNot%2520too%2520long%2520ago%252C%2520I%2520was%2520asked%2520to%2520create%2520a%2520rolling%2520delicious%2520feed%2520using%2520their%2520JSON%2520data.%2520It%2520took%2520me%2520quite%2520a%2520while%2520to%2520realize%2520what%2520was%2520going%2520wrong%2520-%2520but%2520the%2520solution%2520was%2520obvious%2520as%2520soon%2520as%2520the%2520problem%2520became%2520clear.%2520If%2520you%2527re%2520going%2520down%2520the%2520same%2520path%252C%2520m';" title="Digg"><img src="http://www.latentmotion.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" class="sphinn" target="_blank" href="javascript:window.location='http%3A%2F%2Fsphinn.com%2Findex.php%3Fc%3Dpost%26m%3Dsubmit%26link%3Dhttp%253A%252F%252Fwww.latentmotion.com%252Fcalling-remote-json-files-via-javascript-jquery%252F';" title="Sphinn"><img src="http://www.latentmotion.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow" class="del.icio.us" target="_blank" href="javascript:window.location='http%3A%2F%2Fdelicious.com%2Fpost%3Furl%3Dhttp%253A%252F%252Fwww.latentmotion.com%252Fcalling-remote-json-files-via-javascript-jquery%252F%26amp%3Btitle%3DCalling%2520Remote%2520JSON%2520Files%2520via%2520Javascript%2520%252F%2520jQuery%26amp%3Bnotes%3DNot%2520too%2520long%2520ago%252C%2520I%2520was%2520asked%2520to%2520create%2520a%2520rolling%2520delicious%2520feed%2520using%2520their%2520JSON%2520data.%2520It%2520took%2520me%2520quite%2520a%2520while%2520to%2520realize%2520what%2520was%2520going%2520wrong%2520-%2520but%2520the%2520solution%2520was%2520obvious%2520as%2520soon%2520as%2520the%2520problem%2520became%2520clear.%2520If%2520you%2527re%2520going%2520down%2520the%2520same%2520path%252C%2520m';" title="del.icio.us"><img src="http://www.latentmotion.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" class="rss" target="_blank" href="javascript:window.location='http%3A%2F%2Fwww.latentmotion.com%2Ffeed%2F';" title="RSS"><img src="http://www.latentmotion.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow" class="twitter" target="_blank" href="javascript:window.location='http%3A%2F%2Ftwitter.com%2Fhome%3Fstatus%3DCalling%2520Remote%2520JSON%2520Files%2520via%2520Javascript%2520%252F%2520jQuery%2520-%2520http%253A%252F%252Fwww.latentmotion.com%252Fcalling-remote-json-files-via-javascript-jquery%252F';" title="Twitter"><img src="http://www.latentmotion.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.latentmotion.com/calling-remote-json-files-via-javascript-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
