<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>MemeRocket &#187; AJAX</title>
	<atom:link href="http://memerocket.com/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://memerocket.com</link>
	<description>Bill Burcham's Launch Platform</description>
	<lastBuildDate>Tue, 08 Nov 2011 19:50:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='memerocket.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/048c0b3b1b3b5279e320104a4b5d0bb0?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>MemeRocket &#187; AJAX</title>
		<link>http://memerocket.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://memerocket.com/osd.xml" title="MemeRocket" />
	<atom:link rel='hub' href='http://memerocket.com/?pushpress=hub'/>
		<item>
		<title>A Curmudgeon We All Can Love</title>
		<link>http://memerocket.com/2007/11/08/a-curmudgeon-we-all-can-love/</link>
		<comments>http://memerocket.com/2007/11/08/a-curmudgeon-we-all-can-love/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 18:57:18 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[One Step Forward]]></category>
		<category><![CDATA[Web as Platform]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2007/11/08/a-curmudgeon-we-all-can-love/</guid>
		<description><![CDATA[Douglas Crockford, purveyor of the JSONRequest spec, is cranky in a polite sort of way. He also happens to be right! Check out the video of his recent talk on The State of AJAX. Crockford takes us through a brief &#8230; <a href="http://memerocket.com/2007/11/08/a-curmudgeon-we-all-can-love/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=90&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-188" title="rhinobookthumbnail" src="http://memerocket.files.wordpress.com/2009/03/rhinobookthumbnail.gif?w=520" alt="rhinobookthumbnail"   />Douglas Crockford, purveyor of the <a href="http://json.org/JSONRequest.html">JSONRequest spec</a>, is cranky in a polite sort of way. He also happens to be right!  Check out the video of his recent talk on <a href="http://yuiblog.com/blog/2007/11/06/video-crockford/">The State of AJAX</a>.</p>
<p>Crockford takes us through a brief history of computing reminding us, as we&#8217;ve been reminded before, that the Web interaction model is practically the same as the mainframe 3270 interaction model circa 1972.</p>
<p>The most potent moment in the talk however, is when he shows a shot of a mermaid rendered via a run of the mill nvidia subsystem and dryly points out &#8220;look, rounded corners&#8221;. The upshot: the 1984 Macintosh had rounded corners â€” browsers were obsolete from the git go and there is a huge and widening gap between what you do in a web app and what you do in a non-web one.</p>
<p>Oh and I&#8217;m making <a href="http://www.crockford.com/">Crockford</a> my <em>Personal Hero of the Month</em> for pointing out that not only are our web technologies based on eight-year-old standards (HTML 4.0.1, ECMAscript ed. 3, CSS 3) started in &#8217;98 and still under development but that of those, CSS is the <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets#Limitations">worst</a> of the lot and should be replaced with urgent haste. Refreshing respite from the usual <a href="http://www.transcendingcss.com/">CSS love</a>.</p>
<p>&#8220;Don&#8217;t take any crap.&#8221;</p>
<p><strong>update</strong>: watch this space for my growing list of <em>web standards revolutionaries</em>:</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/90/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/90/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=90&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2007/11/08/a-curmudgeon-we-all-can-love/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>

		<media:content url="http://memerocket.files.wordpress.com/2009/03/rhinobookthumbnail.gif" medium="image">
			<media:title type="html">rhinobookthumbnail</media:title>
		</media:content>
	</item>
		<item>
		<title>Agnostic Unobtrusive JavaScript</title>
		<link>http://memerocket.com/2007/09/07/agnostic-unobtrusive-javascript/</link>
		<comments>http://memerocket.com/2007/09/07/agnostic-unobtrusive-javascript/#comments</comments>
		<pubDate>Fri, 07 Sep 2007 17:53:53 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[RJS templates]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2007/09/07/agnostic-unobtrusive-javascript/</guid>
		<description><![CDATA[A few weeks ago I wrote about Unobtrusive JavaScript using the Prototype versus JQuery stacks. In that post I came down on the side of the JQuery stack. Something I didn&#8217;t analyze at the time, was: is it possible to &#8230; <a href="http://memerocket.com/2007/09/07/agnostic-unobtrusive-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=86&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I wrote about <a href="http://www.meme-rocket.com">Unobtrusive JavaScript using the Prototype versus JQuery stacks</a>. In that post I came down on the side of the JQuery stack. Something I didn&#8217;t analyze at the time, was: is it possible to use a little of each? For instance, say (hypothetically) that you have a big old Rails project that uses RJS all over the place and you&#8217;d like to continue using RJS &#8212; is there a way to leverage pieces of JQuery in that scenario.</p>
<p>In this pursuit I learned a few things. Firstly, plain old JQuery does not &#8220;do&#8221; UJS in the following sense: if you bind a behavior to an element (via a CSS selector), that binding will not be reapplied as the DOM is manipulated. For dynamic binding, or &#8220;live&#8221; binding that gets re-applied after every DOM update, you need Brandon Aaron&#8217;s <a href="http://brandonaaron.net/docs/livequery/">livequery</a> plugin for JQuery. Livequery is to JQuery as Dan Webb&#8217;s <a href="http://www.danwebb.net/lowpro">Low Pro</a> is to Prototype &#8212; kind of. Difference being that livequery hooks each of JQuery&#8217;s DOM manipulation routines, whereas Low Pro hooks each of Prototype&#8217;s Ajax.Responders &#8220;onComplete&#8221; event &#8212; the event that happens when an <a href="http://en.wikipedia.org/wiki/XMLHttpRequest">XHR</a> is complete.</p>
<p>What all this means is that you can use JQuery&#8217;s UJS (livequery) if you use JQuery for all your DOM manipulations, or you can use Prototypes UJS (Low Pro) if you use Prototype for all your Ajax calls. The unfortunate bit is that you cannot (yet) use livequery with Prototype Ajax calls, or Low Pro with JQuery DOM manipulations. Can&#8217;t we all just get along?</p>
<p>I wonder if a UJS package could remain stack agnostic. I think livequery is on to something by hooking DOM manipulation routines. That seems more robust (if potentially less performant) than hooking the Ajax returns. By hooking DOM manipulation  it seems that you&#8217;ve plugged more holes and have a more general-purpose solution. Could the livequery approach (of watching for DOM manipulation) be done in a stack-agnostic fashion rather than by hooking JQuery routines? If we could do that then we&#8217;d have a UJS package we could use no matter which JavaScript base library we choose &#8212; or perhaps whichever <a href="http://www.hogwartsprofessor.com/?p=107">library chooses us</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/86/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/86/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=86&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2007/09/07/agnostic-unobtrusive-javascript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>
	</item>
		<item>
		<title>UJS; RJS versus POJS; Prototype Stack versus JQuery Stack</title>
		<link>http://memerocket.com/2007/08/17/ujs-rjs-versus-pojs-prototype-stack-versus-jquery-stack/</link>
		<comments>http://memerocket.com/2007/08/17/ujs-rjs-versus-pojs-prototype-stack-versus-jquery-stack/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 18:29:18 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[RJS templates]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2007/08/17/ujs-rjs-versus-pojs-prototype-stack-versus-jquery-stack/</guid>
		<description><![CDATA[I am accustomed to using Unobtrusive JavaScript (UJS) in my apps. UJS dynamically adds event handlers to the DOM. These event handers implement behaviors via DOM manipulations and XMLHttpRequests (XHR&#8217;s). This approach is in contrast to the historical approach of &#8230; <a href="http://memerocket.com/2007/08/17/ujs-rjs-versus-pojs-prototype-stack-versus-jquery-stack/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=85&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am accustomed to using <a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript">Unobtrusive JavaScript</a> (UJS) in my apps. UJS dynamically adds event handlers to the DOM. These event handers implement behaviors via DOM manipulations and XMLHttpRequests (XHR&#8217;s). This approach is in contrast to the historical approach of specifying event handlers on HTML elements directly. The value of the UJS approach are:</p>
<ul>
<li>it separates behavior (JavaScript) from markup (HTML) and this is good for the same reasons separating style (CSS) from markup is good</li>
<li>it can reduce page weight</li>
</ul>
<p>I had been using <a href="http://www.ujs4rails.com/">ujs4rails</a> but that thing is being <a href="http://www.danwebb.net/2007/6/16/the-state-and-future-of-the-ujs-plugin">deprecated</a> so it isn&#8217;t an option for me.  If I want to do UJS I can either use Prototype or JQuery. I don&#8217;t know of any other good options.</p>
<p>I&#8217;m using JQuery a bit now. Pretty light use: a highlight effect here, a show/hide toggle there; some AJAX form submission. In thinking about how to proceed I&#8217;m kind of torn. I don&#8217;t want to use both JQuery and Prototype longer term. For starters, that&#8217;s too much mental baggage to carry around &#8212; one must gain fluency in one or &#8216;tother I think. Also it&#8217;s a lot of page weight to load both libraries.</p>
<p>Another dimension is RJS vs. POJS. RJS is Rails&#8217; templating and API that lets you generate JavaScript from Ruby. POJS is &#8220;Plain Old JavaScript&#8221;. If we do RJS then we almost have to stay on the Prototype stack. But with POJS a guy could go with either stack and in fact I think the scale tips to the JQuery stack for POJS as I&#8217;ll show in a sec.</p>
<p>So here&#8217;s how I see the top two options:</p>
<p>RJS: Prototype + Scriptaculous + RJS + Dan Webb&#8217;s <a href="http://www.danwebb.net/lowpro">Lowpro</a>:<br />
+ Lowpro supports UJS<br />
+ most of us have used prototype + scriptaculous and are somewhat comfortable with it<br />
+ native Rails (RJS) support<br />
-  Lowpro is not as well documented (nor as widely used) as JQuery for UJS<br />
-  I see no centralized library of plugins  (other than Scriptaculous itself) for this stack</p>
<p>POJS: JQuery + <a href="http://www.danwebb.net/2006/11/24/minusmor-released">MinusMOR</a>:<br />
+ it supports UJS out of the box in a pretty clean way<br />
+ people I respect seem to be moving to JQuery<br />
+ there is a large library of <a href="http://jquery.com/plugins/">plugins</a> including autocompleters and flash upload progress indicators<br />
- very little native Rails (RJS) support &#8212; <a href="http://mad.ly/2007/05/17/jquery-ajax-rails/">you can do some things</a> but it&#8217;s hard to know exactly what will work<br />
- if you already know scriptaculous effects, you have to learn new effects</p>
<p>A big part of this decision hinges on the value of RJS. After <a href="http://www.meme-rocket.com/category/rjs-templates/">using</a> Rails RJS templates for a year and a half or so my conclusion is that they are more trouble than they are worth. Many believe RJS is easier to write/maintain that POJS &#8212; especially for a Ruby programmer. I believe RJS is actually a <a href="http://en.wikipedia.org/wiki/False_economy">false economy</a>. In real applications you really have to code in real JavaScript.</p>
<p>An RJS template generates JavaScript from Ruby code &#8212; but that Ruby API is insufficiently documented (in particular with regard to the scriptaculous effects) and insufficiently capable (e.g. there is <a href="http://www.meme-rocket.com/2007/07/05/id-proliferation-eradication-technique-1-leverage-pageselect-with-pageinsert/">no easy way</a> to update DOM elements matching a CSS selector through that API). Essentially a guy can waste a lot of time trying to get RJS to work for anything but the simplest demos. <strong>So I lean toward plain-old JavaScript (POJS) instead</strong>.</p>
<p>I wonder what you think. Do you place higher value on RJS for real applications? Have you found an alternate stack, or perhaps a different combination of stack elements? Must I pick one stack or the other, or is it possible and profitable to use both at once?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/85/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/85/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=85&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2007/08/17/ujs-rjs-versus-pojs-prototype-stack-versus-jquery-stack/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>
	</item>
		<item>
		<title>ID Proliferation Eradication Technique #1: Leverage page.select with page.insert</title>
		<link>http://memerocket.com/2007/07/05/id-proliferation-eradication-technique-1-leverage-pageselect-with-pageinsert/</link>
		<comments>http://memerocket.com/2007/07/05/id-proliferation-eradication-technique-1-leverage-pageselect-with-pageinsert/#comments</comments>
		<pubDate>Thu, 05 Jul 2007 17:37:27 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[RJS templates]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2007/07/05/id-proliferation-eradication-technique-1-leverage-pageselect-with-pageinsert/</guid>
		<description><![CDATA[update 3/29/2009 8:34 AM: In November, 2007 Brad Wilson pointed out an even cleaner fix. Rather than relying on page.select you can just use page.literal to inject (literal) JavaScript code right where you want it. So recasting my example using &#8230; <a href="http://memerocket.com/2007/07/05/id-proliferation-eradication-technique-1-leverage-pageselect-with-pageinsert/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=76&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="padding-left:30px;"><strong>update</strong> 3/29/2009 8:34 AM: In November, 2007 <a href="http://sentia.com.au/2009/03/using-javascript-code-for-rjs-instead-of-ids/">Brad Wilson pointed out</a> an even cleaner fix. Rather than relying on page.select you can just use page.literal to inject (literal) JavaScript code right where you want it. So recasting my example using page.literal it would look something like this:</p>
<pre class="textmate-source twilight" style="padding-left:30px;"><span class="linenum">    1</span> <span class="source source_ruby source_ruby_rails">page.insert_html <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:bottom</span>, page.literal( <span class="string string_quoted string_quoted_double string_quoted_double_ruby">"$$( '#contact_<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source">#{<span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby">@contact</span>.id}</span> .email-category ul'</span>).first" ), <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:partial</span> =&gt; <span class="string string_quoted string_quoted_single string_quoted_single_ruby">'show'</span>, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:locals</span> =&gt; {<span class="meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block"> </span><span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:show</span> =&gt; <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby">@email_address</span>}</span></pre>
<p>In <a href="2007/04/10/fight-id-proliferation-and-update-any-element-you-want/">Fight id Proliferation</a> I highlighted the prevalent misunderstanding of the prototype API&#8217;s insert_html, replace_html and friends that is evident both in the Prototype documentation and in Rails. Due to that misunderstanding, many of us are polluting our HTML with many more id attributes than would otherwise be necessary. In the original post I proposed a fix to Rails to remedy the situation and allow us to use CSS selectors to identify a target HTML element for the various calls. In this post I provide a workaround you can use now, while waiting for a cleaner fix.</p>
<p><span id="more-76"></span></p>
<p>Previously, I pointed out that we&#8217;d really like to use page.select and more generally, any expression that produces an element, as e.g. the second parameter to page.insert_html.Â  So it would be really nice if this worked:</p>
<pre class="textmate-source twilight"><span class="linenum">    1</span> <span class="source source_ruby source_ruby_rails">page.insert_html <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:bottom</span>, page.select( <span class="string string_quoted string_quoted_double string_quoted_double_ruby">"#contact_<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source">#{<span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby">@contact</span>.id}</span> .email-category ul"</span>).first, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:partial</span> =&gt; <span class="string string_quoted string_quoted_single string_quoted_single_ruby">'show'</span>, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:locals</span> =&gt; {<span class="meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block"> </span><span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:show</span> =&gt; <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby">@email_address</span>}</span></pre>
<p>If that worked, we wouldn&#8217;t need an id on each element representing the email address for a contact.Â  Instead we&#8217;d just put an id on the contact (at the outer level) and we&#8217;d tag the parts of the contact (email address, phone number, etc) with appropriate classes. Much more microformatty.</p>
<p>Well, as you know, you can&#8217;t do that just now in Rails. But there is a workaround.Â  It&#8217;s a bit ugly but it works. And the ugliness is in the RJS, not in the HTML. So your markup is smaller and cleaner, even if you&#8217;re generating an extra line of JavaScript.</p>
<p>The workaround is to use the <code>each</code> method on the result of calling <code>page.select</code>. This lets you iterate (in the browser) over the elements returned from evaluating the CSS selector. Within that iteration, you have available the element of interest. Now that you&#8217;ve got an element, you can call the various page methods that require an element or id such as <code>page.insert position, element</code>. You can also call methods directly on the element itself such as <code>element.reset</code>. Here&#8217;s the previous example recast in this way:</p>
<pre class="textmate-source twilight"><span class="linenum">    1</span> <span class="source source_ruby">              page.select( <span class="string string_quoted string_quoted_double string_quoted_double_ruby">"#contact_<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source">#{<span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby">@contact</span>.id}</span> .email-category ul"</span>).each <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do </span>|element|
<span class="linenum">    2</span>                 page.insert_html <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:bottom</span>, element, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:partial</span> =&gt; <span class="string string_quoted string_quoted_single string_quoted_single_ruby">'show'</span>, <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:locals</span> =&gt; {<span class="meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block"> </span><span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:show</span> =&gt; <span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby">@email_address</span>}
<span class="linenum">    3</span>               <span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<p>This works great in Rails 1.2 even if it is a little bit ugly. By ugly I mean that the code doesn&#8217;t exactly express what we want. Notice that the original code was selecting the <code>first</code> element matched by the CSS selector whereas the workaround code is iterating over all elements matched. So long as you&#8217;re careful to construct CSS selectors that match exactly the number of elements you&#8217;re really after though, you should be ok.</p>
<p>Here&#8217;s a similar snippet but this one calls the Prototype <code>reset</code> method on the element:</p>
<pre class="textmate-source twilight"><span class="linenum">    1</span> <span class="source source_ruby">              page.select( <span class="string string_quoted string_quoted_double string_quoted_double_ruby">"#contact_<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source">#{<span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby">@contact</span>.id}</span> .email-category form"</span>).each <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do </span>|element|
<span class="linenum">    2</span>                 element.reset
<span class="linenum">    3</span>               <span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<p>By tagging only top-level elements with id&#8217;s and using classes to tag internal components you end up with cleaner HTML. This is valuable anywhere you present a list of complex, editable objects. For example, here is one contact of many displayed in a list:</p>
<p><img class="alignnone size-medium wp-image-161" title="Contact Email Address" src="http://memerocket.files.wordpress.com/2009/03/firefoxscreensnapz037.jpg?w=300&#038;h=109" alt="Contact Email Address" width="300" height="109" /></p>
<p>Each contact has a set of email addresses, blog URL&#8217;s and phone numbers. We don&#8217;t want to have to assign id&#8217;s to every single phone number, blog URL and email address on the page. Instead we assign id&#8217;s only to the top-level elements. Here is a contact list with <code>contact_19</code> expanded. Under <code>contact-details</code> we&#8217;ve got email addresses under an element with classes <code>contact-category</code> and <code>email-category</code>. That element contains both the unordered list of email addresses and a form to add new ones:</p>
<pre class="textmate-source twilight"><span class="linenum">    1</span> <span class="text text_html text_html_basic"><span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">ul</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>contacts-list editable<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    2</span>     <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span> <span class="meta meta_attribute-with-value meta_attribute-with-value_id meta_attribute-with-value_id_html"><span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_id entity_other_attribute-name_id_html">id</span><span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_html">=</span><span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span><span class="meta meta_toc-list meta_toc-list_id meta_toc-list_id_html">contact_25</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span></span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>contact-summary<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    3</span>     <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    4</span>     <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span> <span class="meta meta_attribute-with-value meta_attribute-with-value_id meta_attribute-with-value_id_html"><span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_id entity_other_attribute-name_id_html">id</span><span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_html">=</span><span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span><span class="meta meta_toc-list meta_toc-list_id meta_toc-list_id_html">contact_19</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span></span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>contact-summary<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    5</span>         <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>name<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>support@thought-propulsion.com<span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    6</span>         <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>contact-details<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">style</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    7</span>             <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>contact-category email-category<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    8</span>                 <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">h2</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>Email Addresses<span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">h2</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    9</span>                 <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">ul</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   10</span>                     <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>support@thought-propulsion.com<span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   11</span>                 <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">ul</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   12</span>             <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   13</span>             <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>contact-category blog-category<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   14</span>             <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   15</span>             <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>contact-category phone-category<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   16</span>             <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   17</span>         <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">div</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   18</span>     <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   19</span>     <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span> <span class="meta meta_attribute-with-value meta_attribute-with-value_id meta_attribute-with-value_id_html"><span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_id entity_other_attribute-name_id_html">id</span><span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_html">=</span><span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span><span class="meta meta_toc-list meta_toc-list_id meta_toc-list_id_html">contact_22</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span></span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>contact-summary<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   20</span>     <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">   21</span> <span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">ul</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span></span></pre>
<p>So if you want to use <a href="http://www.juixe.com/techknow/index.php/2007/04/03/simply-helpful-rails-plugin/">Simply Helpful</a> to generate your top-level id&#8217;s have at it, but you needn&#8217;t use it to generate id&#8217;s for all the internal parts just because of a little misunderstanding :)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/76/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/76/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=76&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2007/07/05/id-proliferation-eradication-technique-1-leverage-pageselect-with-pageinsert/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>

		<media:content url="http://memerocket.files.wordpress.com/2009/03/firefoxscreensnapz037.jpg?w=300" medium="image">
			<media:title type="html">Contact Email Address</media:title>
		</media:content>
	</item>
		<item>
		<title>Fight id Proliferation and Update Any Element You Want</title>
		<link>http://memerocket.com/2007/04/10/fight-id-proliferation-and-update-any-element-you-want/</link>
		<comments>http://memerocket.com/2007/04/10/fight-id-proliferation-and-update-any-element-you-want/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 18:07:52 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2007/04/10/fight-id-proliferation-and-update-any-element-you-want/</guid>
		<description><![CDATA[update: July 5, 2007: see ID Proliferation Eradication Technique #1… for an update. The Prototype Updater constructor takes an Element (object) or element id (String) as the first parameter. You can see this in prototype.js in Abstract.Insertion.initialize and Ajax.Updater.updateContent . &#8230; <a href="http://memerocket.com/2007/04/10/fight-id-proliferation-and-update-any-element-you-want/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=66&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="padding-left:30px;"><strong>update</strong>: July 5, 2007: see <a href="/2007/07/05/id-proliferation-eradication-technique-1-leverage-pageselect-with-pageinsert/">ID Proliferation Eradication Technique #1…</a> for an update.</p>
<p><img style="float:left;" src="http://www.prototypejs.org/images/logo-home.gif" alt="" /></p>
<p>The <a href="http://www.prototypejs.org/">Prototype</a> Updater constructor takes an Element (object) or element id (String) as the first parameter. You can see this in prototype.js in Abstract.Insertion.initialize and Ajax.Updater.updateContent . In both situations the first parameter sent to the constructor has $() applied before use. And as I&#8217;m sure you&#8217;re aware, the effect of that is that if the parameter is an Element, then the same element is returned. OTOH, if the element is a String, then that string is assumed to be an element id and the Element is found in the DOM and returned.</p>
<p>The big deal here is that the <span style="font-weight:bold;"><a href="http://www.prototypejs.org/api">documentation</a> lies</span> or at a minimum fails to make this point clearly. Have a look at prototype-api.pdf. And this misunderstanding is carried forward in the <a href="http://caboo.se/doc/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html">Rails wrapper API</a> functionality ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods#<a href="http://caboo.se/doc/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html#M005078">insert_html</a>, <a href="http://caboo.se/doc/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html#M005079">replace_html</a>, remove, show, hide, and visual_effect. The result of this misunderstanding is that many JavaScript programmers think they need id&#8217;s all over the place &#8212; and Rails programmers actually <em>do</em> need id&#8217;s all over the place (unless and until the API is repaired&#8230;)</p>
<div>What is wanted in the Ruby wrapper, in order to expose the full capability of the underlying JavaScript libraries, is the ability to pass not only a String (containing an Element id) but optionally to pass an instance of JavaScriptGenerator to insert_html and replace_html and to have that generator rendered. Then we could do (borrowing from the Rails doc and extending&#8230;):</div>
<pre class="textmate-source twilight"><span class="linenum">    1</span> <span class="source source_ruby source_ruby_rails">update_page <span class="keyword keyword_control keyword_control_ruby keyword_control_ruby_start-block">do </span>|page|
<span class="linenum">    2</span>   page.insert_html <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:bottom</span>, page.select(<span class="string string_quoted string_quoted_single string_quoted_single_ruby">'p.welcome b'</span>).first, <span class="string string_quoted string_quoted_double string_quoted_double_ruby">"&lt;li&gt;<span class="source source_ruby source_ruby_embedded source_ruby_embedded_source">#{<span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby">@item</span>.name}</span>&lt;/li&gt;"</span>
<span class="linenum">    3</span>   page.visual_effect <span class="constant constant_other constant_other_symbol constant_other_symbol_ruby">:highlight</span>, <span class="string string_quoted string_quoted_single string_quoted_single_ruby">'list'</span>
<span class="linenum">    4</span>   page.hide <span class="string string_quoted string_quoted_single string_quoted_single_ruby">'status-indicator'</span>, <span class="string string_quoted string_quoted_single string_quoted_single_ruby">'cancel-link'</span>
<span class="linenum">    5</span> <span class="keyword keyword_control keyword_control_ruby">end</span></span></pre>
<p>Note that instead of the simple string literal &#8216;list&#8217; (from the Rails doc) we&#8217;ve got a full-fledged expression there. And generate something like this:</p>
<pre class="textmate-source twilight"><span class="linenum">    1</span> <span class="source source_ruby source_ruby_rails"><span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">new</span> <span class="variable variable_other variable_other_constant variable_other_constant_ruby">Insertion</span>.<span class="variable variable_other variable_other_constant variable_other_constant_ruby">Bottom</span>(<span class="variable variable_other variable_other_readwrite variable_other_readwrite_global variable_other_readwrite_global_pre-defined variable_other_readwrite_global_pre-defined_ruby">$$</span>(<span class="string string_quoted string_quoted_single string_quoted_single_ruby">'p.welcome b'</span>).first, <span class="string string_quoted string_quoted_double string_quoted_double_ruby">"&lt;li&gt;Some item&lt;/li&gt;"</span>);
<span class="linenum">    2</span> <span class="keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby">new</span> <span class="variable variable_other variable_other_constant variable_other_constant_ruby">Effect</span>.<span class="variable variable_other variable_other_constant variable_other_constant_ruby">Highlight</span>(<span class="variable variable_other variable_other_readwrite variable_other_readwrite_global variable_other_readwrite_global_pre-defined variable_other_readwrite_global_pre-defined_ruby">'list'</span>);
<span class="linenum">    3</span> [<span class="string string_quoted string_quoted_double string_quoted_double_ruby">"status-indicator"</span>, <span class="string string_quoted string_quoted_double string_quoted_double_ruby">"cancel-link"</span>].each(<span class="variable variable_other variable_other_constant variable_other_constant_ruby">Element</span>.hide);</span></pre>
<p>But really, the proposed change to the Ruby wrapper isn&#8217;t limited to CSS selectors of course. Once insert_html, replace_html and friends support a full-fledged generator parameter, you could put arbitrary JavaScript in there. The most obvious examples would be calling custom functions and DOM traversal functions.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/66/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/66/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=66&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2007/04/10/fight-id-proliferation-and-update-any-element-you-want/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>

		<media:content url="http://www.prototypejs.org/images/logo-home.gif" medium="image" />
	</item>
		<item>
		<title>Rails IDE Goes Jurassic</title>
		<link>http://memerocket.com/2007/02/13/rails-ide-goes-jurassic/</link>
		<comments>http://memerocket.com/2007/02/13/rails-ide-goes-jurassic/#comments</comments>
		<pubDate>Tue, 13 Feb 2007 15:04:43 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[One Step Forward]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Seaside]]></category>
		<category><![CDATA[Smalltalk]]></category>
		<category><![CDATA[Squeak]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web as Platform]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2007/02/13/rails-ide-goes-jurassic/</guid>
		<description><![CDATA[About a year ago in Smalltalk Browser Goes Jurassic I lamented the fact that the Smalltalk browser UI was caught in a techno-aesthetic time warp and cheered the possibility that it might escape to the future and in doing so &#8230; <a href="http://memerocket.com/2007/02/13/rails-ide-goes-jurassic/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=60&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>About a year ago in <a href="http://www.memerocket.com/2006/02/01/smalltalk-browser-goes-jurassic/">Smalltalk Browser Goes Jurassic</a> I lamented the fact that the Smalltalk browser UI was caught in a techno-aesthetic time warp and cheered the possibility that it might escape to the future and in doing so completely skip a whole generation of UI effort-waste and bad taste (e.g. Eclipse <a href="http://wiki.eclipse.org/index.php/Rich_Client_Platform">Rich Client Platform</a>) and move directly to Web-technology UI currency.  I ended with this:</p>
<blockquote><p>How long will it be before a complete IDE is delivered as a web application? To varying degrees, Eclipse and IntelliJ IDEA are stuck on the same island that Smalltalk was. Theyâ€™re all trying to be graphically rich and run on many platforms. Theyâ€™re all expending lots of resources maintaining UI toolkits (think of Eclipseâ€™s Rich Client Platform). And the resultant UI technology, while often innovative and sometimes pleasing, suffers a â€œcredibility gapâ€ when compared with platform-specific technology on the Mac or Windows. When will the IDEâ€™s throw their weight behind the DHTML+AJAX crowd and embrace the â€œthird platformâ€?</p></blockquote>
<p>Well there is renewed hope &#8211; but it looks like Ruby and Rails may arrive before Squeak does.  <a href="http://gyre.bitscribe.net/">Gyre</a> is an honest-to-goodness Ruby on Rails IDE delivered through the browser complete with source-level interactive debugging, project navigation, and an interesting syntax-aware text editor.</p>
<p>Seems like the next step is to get the <a href="http://gyre.bitscribe.net/">Gyre</a> folks working with the <a href="http://www.getfirebug.com/">Firebug</a> folks.  Can you imagine it?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/60/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/60/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=60&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2007/02/13/rails-ide-goes-jurassic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>
	</item>
		<item>
		<title>Foolproof AJAX Progress Indicator</title>
		<link>http://memerocket.com/2006/12/07/foolproof-ajax-progress-indicator/</link>
		<comments>http://memerocket.com/2006/12/07/foolproof-ajax-progress-indicator/#comments</comments>
		<pubDate>Thu, 07 Dec 2006 22:48:36 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[RJS templates]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2006/12/07/foolproof-ajax-progress-indicator/</guid>
		<description><![CDATA[Bruce Williams is right on in Avoiding AJAX Faux Pas where he lists four inviolable conditions your AJAX code must meet. The first two conditions address the need to show (then hide) a visual progress indicator to let the user &#8230; <a href="http://memerocket.com/2006/12/07/foolproof-ajax-progress-indicator/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=50&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-230" title="wait30" src="http://memerocket.files.wordpress.com/2006/12/wait30.gif?w=520" alt="wait30"   />Bruce Williams is right on in <a href="http://codefluency.com/2006/6/10/rails-views-avoiding-ajax-faux-pas">Avoiding AJAX Faux Pas</a> where he lists four inviolable conditions your AJAX code must meet.  The first two conditions address the need to show (then hide) a visual progress indicator to let the user know that a network operation (<a href="http://en.wikipedia.org/wiki/XMLHttpRequest">XHR</a>) is occurring.  These are important rules.  Unfortunately, the implementation he presents is fraught with difficulties.</p>
<p>Bruce&#8217;s solution is comprised of a Ruby function <code>showing_progress</code> which he suggests you use in every single call to (<code>insert_html, replace_html, replace</code>) to wrap any options you&#8217;d normally pass to those routines.  The <code>showing_progress</code> routine adds <code>:loading</code> and <code>:complete</code> handlers that will show, then hide an element with id &#8216;progress&#8217; on your page.</p>
<p>The solution is kind of elegant and it works as advertised but I ran into a few problems as I got deeper into my app:</p>
<ol>
<li>I forgot to call <code>showing_progress</code> in new invocations of <code>insert_html, replace_html, replace</code> &#8212; as a result I didn&#8217;t get progress indication in those cases</li>
<li>The solution works only for Ruby RJS code &#8212; if you write JavaScript that calls <code>Ajax.Request</code> and <code>Ajax.Updater</code> then the solution of course doesn&#8217;t help.</li>
<li>The solution ruthlessly overwrites any :loading and :complete handlers you&#8217;ve defined in your options</li>
</ol>
<p>How about a solution that works for both Ruby and JavaScript?  It&#8217;d be nice if it didn&#8217;t rely on the programmer remembering to call it everywhere?  It&#8217;d be even nicer if it didn&#8217;t interfere with your application&#8217;s :loading and :complete handlers.</p>
<p>Here&#8217;s the solution I&#8217;m using.  I don&#8217;t recall where I first saw it but I&#8217;m pretty sure I didn&#8217;t invent it.  I see Nicky Peeters was suggesting a similar thing over a <a href="http://lists.rubyonrails.org/pipermail/rails-spinoffs/2005-December/001649.html">year ago</a>.  Just put this code in application.js:</p>
<pre class="textmate-source twilight"><span class="linenum">    1</span> <span class="source source_prototype source_prototype_js"><span class="support support_class support_class_prototype support_class_prototype_js">Ajax</span><span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_class support_class_prototype support_class_prototype_js">Responders</span><span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_function support_function_prototype support_function_prototype_js">register</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>
<span class="linenum">    2</span> <span class="meta meta_property meta_property_function meta_property_function_prototype meta_property_function_prototype_js"><span class="object object_property object_property_function object_property_function_prototype object_property_function_prototype_js">onCreate</span>: <span class="entity entity_name entity_name_function entity_name_function_prototype entity_name_function_prototype_js">function</span>()</span> <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>
<span class="linenum">    3</span>  <span class="keyword keyword_control keyword_control_js">if</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="keyword keyword_operator keyword_operator_js">$</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>progress<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span> <span class="keyword keyword_operator keyword_operator_js">&amp;&amp;</span> <span class="support support_class support_class_prototype support_class_prototype_js">Ajax</span><span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_function support_function_prototype support_function_prototype_js">activeRequestCount</span><span class="keyword keyword_operator keyword_operator_js">&gt;</span><span class="constant constant_numeric constant_numeric_js">0</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span>
<span class="linenum">    4</span>  <span class="support support_class support_class_prototype support_class_prototype_js">Effect</span><span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_class support_class_prototype support_class_prototype_js">Appear</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>progress<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,</span><span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>duration:<span class="constant constant_numeric constant_numeric_js">0.5</span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,</span>queue:<span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>end<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>
<span class="linenum">    5</span> <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,</span>
<span class="linenum">    6</span>
<span class="linenum">    7</span> <span class="meta meta_property meta_property_function meta_property_function_prototype meta_property_function_prototype_js"><span class="object object_property object_property_function object_property_function_prototype object_property_function_prototype_js">onComplete</span>: <span class="entity entity_name entity_name_function entity_name_function_prototype entity_name_function_prototype_js">function</span>()</span> <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>
<span class="linenum">    8</span>  <span class="keyword keyword_control keyword_control_js">if</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="keyword keyword_operator keyword_operator_js">$</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>progress<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span> <span class="keyword keyword_operator keyword_operator_js">&amp;&amp;</span> <span class="support support_class support_class_prototype support_class_prototype_js">Ajax</span><span class="meta meta_function meta_function_js">.<span class="entity entity_name entity_name_function entity_name_function_js">activeRequestCount</span>=</span><span class="keyword keyword_operator keyword_operator_js">=</span><span class="constant constant_numeric constant_numeric_js">0</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span>
<span class="linenum">    9</span>  <span class="support support_class support_class_prototype support_class_prototype_js">Effect</span><span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_class support_class_prototype support_class_prototype_js">Fade</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>progress<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,</span><span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>duration:<span class="constant constant_numeric constant_numeric_js">0.5</span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,</span>queue:<span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>end<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>
<span class="linenum">   10</span> <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span>
<span class="linenum">   11</span> <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>
</span></pre>
<p>And stick something like this in your layout:</p>
<pre class="textmate-source twilight"><span class="linenum">    1</span> <span class="text text_html text_html_basic">                <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">span</span> <span class="meta meta_attribute-with-value meta_attribute-with-value_id meta_attribute-with-value_id_html"><span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_id entity_other_attribute-name_id_html">id</span><span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_html">=</span><span class="string string_quoted string_quoted_single string_quoted_single_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">'</span><span class="meta meta_toc-list meta_toc-list_id meta_toc-list_id_html">progress</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">'</span></span></span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">style</span>=<span class="string string_quoted string_quoted_single string_quoted_single_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">'</span>display:none;<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">'</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    2</span>                     <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">img</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">src</span>=<span class="string string_quoted string_quoted_single string_quoted_single_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">'</span>/images/busy.gif<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">'</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
<span class="linenum">    3</span>                 <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">span</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_html">&gt;</span></span>
</span></pre>
<p>And you&#8217;ll have one less worry in your life.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/50/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/50/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=50&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2006/12/07/foolproof-ajax-progress-indicator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>

		<media:content url="http://memerocket.files.wordpress.com/2006/12/wait30.gif" medium="image">
			<media:title type="html">wait30</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript-Ruby Convergence</title>
		<link>http://memerocket.com/2006/11/03/javascript-ruby-convergence/</link>
		<comments>http://memerocket.com/2006/11/03/javascript-ruby-convergence/#comments</comments>
		<pubDate>Fri, 03 Nov 2006 12:35:52 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Web as Platform]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2006/11/03/javascript-ruby-convergence/</guid>
		<description><![CDATA[You may have noticed that the latest release of Firefox (2.0) supports JavaScript 1.7.Â  I was curious about just what the new JavaScript features were so I did a little poking around.Â  It turns out that if you peel back &#8230; <a href="http://memerocket.com/2006/11/03/javascript-ruby-convergence/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=33&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You may have noticed that the <a href="http://www.mozilla.com/en-US/press/mozilla-2006-10-24.html">latest</a> release of Firefox (2.0) supports <a href="http://en.wikipedia.org/wiki/Javascript">JavaScript</a> 1.7.Â  I was curious about just what the new JavaScript features were so I did a little poking around.Â  It turns out that if you peel back a little of the arbitrarily divergent terminology you find some features that map perfectly onto Ruby.Â  JavaScript (1.6) and Ruby already had a lot in common.Â  But with JavaScript 1.7 its hard not to suspect a conscious, coordinated convergence conspiracy.</p>
<p>JavaScript <a href="http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Generators_and_iterators">generators and iterators</a> are now supported through the familiar (to Rubyists) <strong>yield</strong> keyword.Â  A generator is a function that yields values &#8212; like a coroutine.Â  It isn&#8217;t obvious how to implement the Ruby cornerstone: yield to a block passed to a method, but being able to do coroutines is a welcome advance.</p>
<p>Then there&#8217;s this thing that JavaScript 1.7 calls <a href="http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Destructuring_assignment">destructuring assignment</a> which essentially lets you have <span style="font-weight:bold;">multiple return</span> values from a function &#8212; just like Ruby.<br />
On the browser front, it looks like IE7 is going to support JavaScript 1.6 and not 1.7 initially, so from a client-side perspective this is kind of academic for the moment. Â  However the convergence is hopeful from the perspective of can&#8217;t-we-all-just-get-along VM sharing a la <a href="http://www.parrotcode.org/">parrot</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=33&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2006/11/03/javascript-ruby-convergence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>
	</item>
		<item>
		<title>Tell TextMate About Your RJS Templates</title>
		<link>http://memerocket.com/2006/02/10/tell-textmate-about-your-rjs-templates/</link>
		<comments>http://memerocket.com/2006/02/10/tell-textmate-about-your-rjs-templates/#comments</comments>
		<pubDate>Fri, 10 Feb 2006 19:38:20 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[RJS templates]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[TextMate]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2006/02/10/tell-textmate-about-your-rjs-templates/</guid>
		<description><![CDATA[As explanations go, it doesn&#8217;t get much more straightforward than Cody Fauser&#8217;s excellent post on Rails RJS Templates. When you try it out though, you may notice that TextMate doesn&#8217;t know that RJS templates which by convention have an &#8220;.rjs&#8221; &#8230; <a href="http://memerocket.com/2006/02/10/tell-textmate-about-your-rjs-templates/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=10&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="float:right;margin-left:10px;">
<p>As explanations go, it doesn&#8217;t get much more straightforward than Cody Fauser&#8217;s <a title="Cody Fauser on RJS" href="http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates">excellent post</a> on Rails RJS Templates. When you try it out though, you may notice that TextMate doesn&#8217;t know that RJS templates which by convention have an &#8220;.rjs&#8221; suffix, are really Ruby code. If you want to make TextMate aware of the &#8220;.rjs&#8221; suffix simply open the Bundle Editor window, navigate to the Ruby bundle, scroll down to the Ruby language definition (it has a Gray circular icon with an &#8220;L&#8221; on it), and add &#8216;rjs&#8217; to the list of fileTypes.</p>
<p><img class="alignright size-full wp-image-156" title="add-rjs-to-ruby-bundle1" src="http://memerocket.files.wordpress.com/2006/02/add-rjs-to-ruby-bundle1.gif?w=520" alt="add-rjs-to-ruby-bundle1"   /></p>
<p>Once you do that, TextMate will treat .rjs files like other Ruby files and you&#8217;ll get syntax highlighting and stuff.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=10&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2006/02/10/tell-textmate-about-your-rjs-templates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>

		<media:content url="http://memerocket.files.wordpress.com/2006/02/add-rjs-to-ruby-bundle1.gif" medium="image">
			<media:title type="html">add-rjs-to-ruby-bundle1</media:title>
		</media:content>
	</item>
		<item>
		<title>script.aculo.us InPlaceEditor Drops Paragraph Tags</title>
		<link>http://memerocket.com/2006/02/08/in_place_editor_drops_paragraph_tags/</link>
		<comments>http://memerocket.com/2006/02/08/in_place_editor_drops_paragraph_tags/#comments</comments>
		<pubDate>Wed, 08 Feb 2006 22:35:03 +0000</pubDate>
		<dc:creator>Bill Burcham</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.meme-rocket.com/2006/02/08/in_place_editor_drops_paragraph_tags/</guid>
		<description><![CDATA[I submitted a Rails/script.aculo.us defect describing how Ajax.InPlaceEditor is stripping paragraph tags when loading the textfield/textarea. While waiting for the Universe to respond, I&#8217;ve had some time to research the issue a little more. Interestingly, the behavior seems to have &#8230; <a href="http://memerocket.com/2006/02/08/in_place_editor_drops_paragraph_tags/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=8&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I submitted a Rails/script.aculo.us <a title="Rails ticket 3729" href="http://dev.rubyonrails.org/ticket/3729">defect</a> describing how Ajax.InPlaceEditor is stripping paragraph tags when loading the textfield/textarea.  While waiting for the Universe to respond, I&#8217;ve had some time to research the issue a little more.  Interestingly, the behavior seems to have originated with a <a title="Raisl changeset 2282" href="http://dev.rubyonrails.org/changeset/2282">changeset</a> committed last September.  That changeset actually addressed two issues: it fixed a Safari bug, and it added the convertHTMLLineBreaks functionality.</p>
<p>I hope the apparent <a title="Jon Tirsen" href="http://jutopia.tirsen.com/articles/2006/02/06/selenium-and-rails">author</a> of the convertHTMLLineBreaks functionality will notice this ping to his blog.  (I realize my approach for making contact is a bit unorthodox, but my feeling is that this constitutes better manners than intruding via email &#8212; though I can&#8217;t find his email address anyway).  I&#8217;d like to understand more about the original reasons for the convertHTMLineBreaks functionality.  What problems does it solve?  Why does it need to strip paragraph tags as well as line breaks.  And perhaps most importantly &#8212; why doesn&#8217;t it put something back in their place when the edited content is injected back into the DOM?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/memerocket.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/memerocket.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/memerocket.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/memerocket.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/memerocket.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/memerocket.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/memerocket.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/memerocket.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/memerocket.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/memerocket.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/memerocket.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/memerocket.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/memerocket.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/memerocket.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/memerocket.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/memerocket.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=memerocket.com&amp;blog=5432592&amp;post=8&amp;subd=memerocket&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://memerocket.com/2006/02/08/in_place_editor_drops_paragraph_tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a88a8da103044de18418f303bf0c1507?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">bburcham</media:title>
		</media:content>
	</item>
	</channel>
</rss>
