<?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: My wishlist for a great Ajax API</title>
	<atom:link href="http://www.wait-till-i.com/2008/04/08/my-wishlist-for-a-great-ajax-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wait-till-i.com/2008/04/08/my-wishlist-for-a-great-ajax-api/</link>
	<description>Chris Heilmann - Accessibility, Web Development and Pragmatism - can talk, will travel</description>
	<lastBuildDate>Sat, 04 Jul 2009 15:00:41 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: John DeHope</title>
		<link>http://www.wait-till-i.com/2008/04/08/my-wishlist-for-a-great-ajax-api/comment-page-1/#comment-7449</link>
		<dc:creator>John DeHope</dc:creator>
		<pubDate>Wed, 09 Apr 2008 14:11:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.wait-till-i.com/2008/04/08/my-wishlist-for-a-great-ajax-api/#comment-7449</guid>
		<description>I threw together something to adress &quot;What goes in should come out&quot; as well as ensuring a synchronous user experience of asynchronous requests. Sure I don&#039;t want to queue up the request process, but I do want to queue up the responding process, so that responses are handled in the order they were requested in.

&lt;pre&gt;&lt;code&gt;
ajax.fifo = [];
ajax.call ( req_url, req_body, req_timeout, call_extras, resp_ok_func, resp_fail_func )
{
	// build up an object containing everything you&#039;d ever want to know about this ajax call
	var call = 
	{
		&#039;req_url&#039; : req_url;
		&#039;req_body&#039; : req_body;
		&#039;req_timeout&#039; : req_timeout;
		&#039;call_extras&#039; : call_extras;
		&#039;resp_ok_func&#039; : resp_ok_func;
		&#039;resp_fail_func&#039; : resp_fail_func;
		&#039;resp_http_nbr&#039; : null;
		&#039;resp_http_body&#039; : null;
	} ;
	// put this call on the ajax fifo
	ajax.fifo.push( call );
	// set up a callback for the ajax implementation, the developer never sees this
	var inner_resp_func = function(resp_http_nbr, resp_http_body)
	{
		call.resp_http_nbr = resp_http_nbr;
		call.resp_http_body = resp_http_body;
		ajax.handle();
	}
	// make the call
	{ajax implementation}.( req_url, req_body, req_timeout, inner_resp_func );
}
ajax.handle()
{
	if ( ajax.fifo.length &gt; 0
		&amp;&amp; ajax.fifo[0].resp_http_nbr != null)
	{
		var call = ajax.fifo.shift();
		if ( call.resp_num == 200 )
		{
			call.resp_ok_func( job );
		}
		else
		{
			call.resp_fail_func( job );
		}
		setTimeout(&#039;ajax.handle();&#039;, 10);
	}
}
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I threw together something to adress &#8220;What goes in should come out&#8221; as well as ensuring a synchronous user experience of asynchronous requests. Sure I don&#8217;t want to queue up the request process, but I do want to queue up the responding process, so that responses are handled in the order they were requested in.</p>
<pre><code>
ajax.fifo = [];
ajax.call ( req_url, req_body, req_timeout, call_extras, resp_ok_func, resp_fail_func )
{
	// build up an object containing everything you'd ever want to know about this ajax call
	var call =
	{
		'req_url' : req_url;
		'req_body' : req_body;
		'req_timeout' : req_timeout;
		'call_extras' : call_extras;
		'resp_ok_func' : resp_ok_func;
		'resp_fail_func' : resp_fail_func;
		'resp_http_nbr' : null;
		'resp_http_body' : null;
	} ;
	// put this call on the ajax fifo
	ajax.fifo.push( call );
	// set up a callback for the ajax implementation, the developer never sees this
	var inner_resp_func = function(resp_http_nbr, resp_http_body)
	{
		call.resp_http_nbr = resp_http_nbr;
		call.resp_http_body = resp_http_body;
		ajax.handle();
	}
	// make the call
	{ajax implementation}.( req_url, req_body, req_timeout, inner_resp_func );
}
ajax.handle()
{
	if ( ajax.fifo.length &amp;gt; 0
		&amp;amp;&amp;amp; ajax.fifo[0].resp_http_nbr != null)
	{
		var call = ajax.fifo.shift();
		if ( call.resp_num == 200 )
		{
			call.resp_ok_func( job );
		}
		else
		{
			call.resp_fail_func( job );
		}
		setTimeout('ajax.handle();', 10);
	}
}
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Rushgrove</title>
		<link>http://www.wait-till-i.com/2008/04/08/my-wishlist-for-a-great-ajax-api/comment-page-1/#comment-7440</link>
		<dc:creator>Gareth Rushgrove</dc:creator>
		<pubDate>Tue, 08 Apr 2008 23:05:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.wait-till-i.com/2008/04/08/my-wishlist-for-a-great-ajax-api/#comment-7440</guid>
		<description>Nice writeup. I&#039;m liking this idea of API reviews, especially the dream implementation stuff. Mmmm, which API to take to write up though? Upcoming maybe (maybe too nasty)? Or S3 (maybe too obvious)?</description>
		<content:encoded><![CDATA[<p>Nice writeup. I&#8217;m liking this idea of <span class="caps">API </span>reviews, especially the dream implementation stuff. Mmmm, which <span class="caps">API </span>to take to write up though? Upcoming maybe (maybe too nasty)? Or S3 (maybe too obvious)?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
