<?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"
	>
<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 - Accessibilty, Web Development and Pragmatism - can talk, will travel</description>
	<pubDate>Sun, 06 Jul 2008 19:55:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: John DeHope</title>
		<link>http://www.wait-till-i.com/2008/04/08/my-wishlist-for-a-great-ajax-api/#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 "What goes in should come out" as well as ensuring a synchronous user experience of asynchronous requests. Sure I don'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'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 &#62; 0
		&#38;&#38; 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);
	}
}
&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&#8217;d ever want to know about this ajax call
	var call =
	{
		&#8216;req_url&#8217; : req_url;
		&#8216;req_body&#8217; : req_body;
		&#8216;req_timeout&#8217; : req_timeout;
		&#8216;call_extras&#8217; : call_extras;
		&#8216;resp_ok_func&#8217; : resp_ok_func;
		&#8216;resp_fail_func&#8217; : resp_fail_func;
		&#8216;resp_http_nbr&#8217; : null;
		&#8216;resp_http_body&#8217; : 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(&#8217;ajax.handle();&#8217;, 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-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'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>
