<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: JSON-P output with Rails</title>
	<atom:link href="http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<lastBuildDate>Sat, 07 Nov 2009 23:35:20 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ragnarok&#187; Blog Archive &#187; [Ruby文档中文化团队]用NetBeans Ruby 实践JMaki1.0</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-708931</link>
		<dc:creator>Ragnarok&#187; Blog Archive &#187; [Ruby文档中文化团队]用NetBeans Ruby 实践JMaki1.0</dc:creator>
		<pubDate>Mon, 28 Apr 2008 15:52:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-708931</guid>
		<description>[...] with Rails 9f/^m.PD+i:ITl.pD0 原文作者：Tim Lucas &#8216;`/Sn@&#124;T0 原文地址：http://www.sitepoint.com/blogs/2 &#8230; -output-with-rails/ My0qI]0 Ruby Community:S mYM_6&#124;1wa 译者：Ragnarok@Ruby中文社区翻译团队 [...]</description>
		<content:encoded><![CDATA[<p>[...] with Rails 9f/^m.PD+i:ITl.pD0 原文作者：Tim Lucas &#8216;`/Sn@|T0 原文地址：http://www.sitepoint.com/blogs/2 &#8230; -output-with-rails/ My0qI]0 Ruby Community:S mYM_6|1wa 译者：Ragnarok@Ruby中文社区翻译团队 [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-657017</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Tue, 18 Mar 2008 12:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-657017</guid>
		<description>Can you show a cross browser JSON post example?</description>
		<content:encoded><![CDATA[<p>Can you show a cross browser JSON post example?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Mahemoff</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-202140</link>
		<dc:creator>Michael Mahemoff</dc:creator>
		<pubDate>Tue, 13 Mar 2007 13:50:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-202140</guid>
		<description>Tim, yes Bob&#039;s original post is the closest thing to a definitive reference I know of. Maybe it could do with an RFC just to give it some more momentum and cred with the enterprise.

Agree, &quot;callback&quot; works too and is arguably better as it is just as general and intuitive. Downside is it can&#039;t be inlined as an anonymous function, so it may entail a bit more JS code than some JSONP usages, which may make people want &quot;variable&quot; too, which starts to get complex and error-prone for API providers, which is the argument for JSONP :). If I were implementing an API, I would probably provide all three, as they can happily co-exist.</description>
		<content:encoded><![CDATA[<p>Tim, yes Bob&#8217;s original post is the closest thing to a definitive reference I know of. Maybe it could do with an RFC just to give it some more momentum and cred with the enterprise.</p>
<p>Agree, &#8220;callback&#8221; works too and is arguably better as it is just as general and intuitive. Downside is it can&#8217;t be inlined as an anonymous function, so it may entail a bit more JS code than some JSONP usages, which may make people want &#8220;variable&#8221; too, which starts to get complex and error-prone for API providers, which is the argument for JSONP :). If I were implementing an API, I would probably provide all three, as they can happily co-exist.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: timlucas</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-197860</link>
		<dc:creator>timlucas</dc:creator>
		<pubDate>Thu, 08 Mar 2007 21:25:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-197860</guid>
		<description>Michael: thanks for clearing that up. What&#039;s being used as the definitive document describing JSONP &quot;protocol&quot;? Bob Ippolito&#039;s blog post it? It&#039;s definitely sensible to reduce it all down to one parameter and keep it consistent between services. I like the idea of keeping it generic, and calling it &quot;jsonp&quot;, though I think the concept of a &quot;callback&quot; parameter (as is used by a fair few APIs now) is somewhat more intuitive than a generic &quot;jsonp&quot; parameter.</description>
		<content:encoded><![CDATA[<p>Michael: thanks for clearing that up. What&#8217;s being used as the definitive document describing JSONP &#8220;protocol&#8221;? Bob Ippolito&#8217;s blog post it? It&#8217;s definitely sensible to reduce it all down to one parameter and keep it consistent between services. I like the idea of keeping it generic, and calling it &#8220;jsonp&#8221;, though I think the concept of a &#8220;callback&#8221; parameter (as is used by a fair few APIs now) is somewhat more intuitive than a generic &#8220;jsonp&#8221; parameter.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Mahemoff</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-197558</link>
		<dc:creator>Michael Mahemoff</dc:creator>
		<pubDate>Thu, 08 Mar 2007 13:14:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-197558</guid>
		<description>Strictly speaking, this isn&#039;t really the &quot;JSONP&quot; protocol AFAICT, but an application of the principle behind JSONP. That is, don&#039;t just return JSON, but instead let the caller tell the server how to augment the JSON.

JSONP is a simple protocol where there&#039;s a single relevant parameter in the URL, called precisely &quot;jsonp&quot;. The idea is to be as general as possible. Using JSONP, it is possible to specify a callback or a variable or anything else you could imagine (e.g. you could pass in &quot;jsonp&quot; param as &quot;el.style.backgroundColor=&quot; to affect an element&#039;s appearance).

http://ajaxian.com/archives/jsonp-json-with-padding</description>
		<content:encoded><![CDATA[<p>Strictly speaking, this isn&#8217;t really the &#8220;JSONP&#8221; protocol AFAICT, but an application of the principle behind JSONP. That is, don&#8217;t just return JSON, but instead let the caller tell the server how to augment the JSON.</p>
<p>JSONP is a simple protocol where there&#8217;s a single relevant parameter in the URL, called precisely &#8220;jsonp&#8221;. The idea is to be as general as possible. Using JSONP, it is possible to specify a callback or a variable or anything else you could imagine (e.g. you could pass in &#8220;jsonp&#8221; param as &#8220;el.style.backgroundColor=&#8221; to affect an element&#8217;s appearance).</p>
<p><a href="http://ajaxian.com/archives/jsonp-json-with-padding" rel="nofollow">http://ajaxian.com/archives/jsonp-json-with-padding</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: timlucas</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-141491</link>
		<dc:creator>timlucas</dc:creator>
		<pubDate>Fri, 29 Dec 2006 00:48:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-141491</guid>
		<description>yeah: what do you mean? There&#039;s nothing GET specific about this. It&#039;ll work just fine for PUT and POST too.</description>
		<content:encoded><![CDATA[<p>yeah: what do you mean? There&#8217;s nothing GET specific about this. It&#8217;ll work just fine for PUT and POST too.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: yeah</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-135233</link>
		<dc:creator>yeah</dc:creator>
		<pubDate>Sun, 24 Dec 2006 18:20:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-135233</guid>
		<description>so what about PUT and POST?</description>
		<content:encoded><![CDATA[<p>so what about PUT and POST?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Oddly Zen &#187; Blog Archive &#187; links for 2006-12-01</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-112587</link>
		<dc:creator>Oddly Zen &#187; Blog Archive &#187; links for 2006-12-01</dc:creator>
		<pubDate>Fri, 01 Dec 2006 16:26:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-112587</guid>
		<description>[...] SitePoint Blogs » JSON-P output with Rails Wow. I like their code blocks, too. Neato. (tags: json rubyonrails rails jsonp Programming webdesign) [...]</description>
		<content:encoded><![CDATA[<p>[...] SitePoint Blogs » JSON-P output with Rails Wow. I like their code blocks, too. Neato. (tags: json rubyonrails rails jsonp Programming webdesign) [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dr Nic &#187; Supporting JSON callbacks in Rails</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-104789</link>
		<dc:creator>Dr Nic &#187; Supporting JSON callbacks in Rails</dc:creator>
		<pubDate>Fri, 24 Nov 2006 08:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-104789</guid>
		<description>[...] Tim Lucas wrote a great article introducing a render_json method to add to your base ApplicationController. [...]</description>
		<content:encoded><![CDATA[<p>[...] Tim Lucas wrote a great article introducing a render_json method to add to your base ApplicationController. [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: timlucas</title>
		<link>http://www.sitepoint.com/blogs/2006/10/05/json-p-output-with-rails/comment-page-1/#comment-103520</link>
		<dc:creator>timlucas</dc:creator>
		<pubDate>Thu, 23 Nov 2006 06:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1729#comment-103520</guid>
		<description>Sorry jp, I was a little over-concise. You&#039;ll also want to respond to html:
&lt;pre&gt;&lt;code&gt;
 def show
    @grocery = Grocery.find(params[:id])
	
    respond_to do &#124;format&#124;
        format.html # falls back on the rhtml file
        format.js { render_json @grocery.to_json }
    end
  end
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Sorry jp, I was a little over-concise. You&#8217;ll also want to respond to html:</p>
<pre><code>
 def show
    @grocery = Grocery.find(params[:id])
	
    respond_to do |format|
        format.html # falls back on the rhtml file
        format.js { render_json @grocery.to_json }
    end
  end
</code></pre>]]></content:encoded>
	</item>
</channel>
</rss>
