<?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; script.aculo.us</title>
	<atom:link href="http://memerocket.com/category/scriptaculous/feed/" rel="self" type="application/rss+xml" />
	<link>http://memerocket.com</link>
	<description>Bill Burcham's Launch Platform</description>
	<lastBuildDate>Sun, 19 Feb 2012 03:56:34 +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; script.aculo.us</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>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&#038;blog=5432592&#038;post=85&#038;subd=memerocket&#038;ref=&#038;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&#038;blog=5432592&#038;post=85&#038;subd=memerocket&#038;ref=&#038;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>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&#038;blog=5432592&#038;post=66&#038;subd=memerocket&#038;ref=&#038;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&#038;blog=5432592&#038;post=66&#038;subd=memerocket&#038;ref=&#038;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>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&#038;blog=5432592&#038;post=50&#038;subd=memerocket&#038;ref=&#038;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&#038;blog=5432592&#038;post=50&#038;subd=memerocket&#038;ref=&#038;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>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&#038;blog=5432592&#038;post=8&#038;subd=memerocket&#038;ref=&#038;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&#038;blog=5432592&#038;post=8&#038;subd=memerocket&#038;ref=&#038;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>
