<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A DOM Ready Extension for Prototype</title>
	<atom:link href="http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/</link>
	<description>Making stuff work on the other side of the request.</description>
	<lastBuildDate>Tue, 05 Jan 2010 18:16:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: zaenal</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-31477</link>
		<dc:creator>zaenal</dc:creator>
		<pubDate>Fri, 29 Aug 2008 22:46:47 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-31477</guid>
		<description>A shortcut for version 1.6++, just call &quot;document.loaded&quot; (boolean).

if (document.loaded===true) alert(&quot;DOM is ready&quot;);
else alert(&quot;DOMReady is not ready&quot;);</description>
		<content:encoded><![CDATA[<p>A shortcut for version 1.6++, just call &#8220;document.loaded&#8221; (boolean).</p>
<p>if (document.loaded===true) alert(&#8220;DOM is ready&#8221;);<br />
else alert(&#8220;DOMReady is not ready&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-28315</link>
		<dc:creator>Al</dc:creator>
		<pubDate>Fri, 04 Apr 2008 05:00:40 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-28315</guid>
		<description>For anyone who&#039;s come here recently, prototype after 1.6 now contains similar code - it can be called by document.observe(&#039;dom:loaded&#039;, function(){...});</description>
		<content:encoded><![CDATA[<p>For anyone who&#8217;s come here recently, prototype after 1.6 now contains similar code &#8211; it can be called by document.observe(&#8216;dom:loaded&#8217;, function(){&#8230;});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Nguyen</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-17410</link>
		<dc:creator>Eric Nguyen</dc:creator>
		<pubDate>Mon, 16 Jul 2007 23:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-17410</guid>
		<description>There&#039;s a more current discussion of options here, guys:

http://www.codestore.net/store.nsf/unid/BLOG-20070604

I&#039;ve had trouble in IE with the code inlined, above.</description>
		<content:encoded><![CDATA[<p>There&#8217;s a more current discussion of options here, guys:</p>
<p><a href="http://www.codestore.net/store.nsf/unid/BLOG-20070604" rel="nofollow">http://www.codestore.net/store.nsf/unid/BLOG-20070604</a></p>
<p>I&#8217;ve had trouble in IE with the code inlined, above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron N.</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-17388</link>
		<dc:creator>Aaron N.</dc:creator>
		<pubDate>Mon, 16 Jul 2007 16:01:53 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-17388</guid>
		<description>@Moritz, your syntax is correct FOR MOOTOOLS only. If you pass a function to domready and the page is already loaded, your function will execute immediately.

@Francisco, there are numerous versions of domready floating around out there. Most frameworks have a solution for this already, and if you aren&#039;t using one, you really, really should.</description>
		<content:encoded><![CDATA[<p>@Moritz, your syntax is correct FOR MOOTOOLS only. If you pass a function to domready and the page is already loaded, your function will execute immediately.</p>
<p>@Francisco, there are numerous versions of domready floating around out there. Most frameworks have a solution for this already, and if you aren&#8217;t using one, you really, really should.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francisco Hernandez</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-17231</link>
		<dc:creator>Francisco Hernandez</dc:creator>
		<pubDate>Fri, 13 Jul 2007 23:45:54 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-17231</guid>
		<description>heres an updated version that works with ie6+https

http://snipplr.com/view/2337/ondomready/</description>
		<content:encoded><![CDATA[<p>heres an updated version that works with ie6+https</p>
<p><a href="http://snipplr.com/view/2337/ondomready/" rel="nofollow">http://snipplr.com/view/2337/ondomready/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moritz</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-17119</link>
		<dc:creator>Moritz</dc:creator>
		<pubDate>Wed, 11 Jul 2007 21:50:42 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-17119</guid>
		<description>Just a short question regarding onDomReady: Is window.addEvent(&#039;domready&#039;, function(){ ... the right way to check if the DOM has been rebuild after adding new elements to the page through an ajax call?</description>
		<content:encoded><![CDATA[<p>Just a short question regarding onDomReady: Is window.addEvent(&#8216;domready&#8217;, function(){ &#8230; the right way to check if the DOM has been rebuild after adding new elements to the page through an ajax call?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron N.</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-16606</link>
		<dc:creator>Aaron N.</dc:creator>
		<pubDate>Fri, 06 Jul 2007 16:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-16606</guid>
		<description>Note that this post is a year old, but yes, this is the recommended way to attached your page-load events. For what you want, you would have your preloader there by default and, when your javascript is ready, hide it (with javascript) on domready. Note that most javascript frameworks (we use Mootools) have this functionality already built into them now, so you don&#039;t need this stand-alone script if you&#039;re using Prototype, YUI, Dojo, jQuery, Mootools, etc.</description>
		<content:encoded><![CDATA[<p>Note that this post is a year old, but yes, this is the recommended way to attached your page-load events. For what you want, you would have your preloader there by default and, when your javascript is ready, hide it (with javascript) on domready. Note that most javascript frameworks (we use Mootools) have this functionality already built into them now, so you don&#8217;t need this stand-alone script if you&#8217;re using Prototype, YUI, Dojo, jQuery, Mootools, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-16595</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Fri, 06 Jul 2007 14:31:10 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-16595</guid>
		<description>Is this still a recommended way to do this?  I&#039;m not really a javascript expert, but what I&#039;m looking for is a way to dump a preloader on the page while the whole DOM is loading and after it&#039;s loaded and all the onload javascript is executed the preloader goes away and the rest of the content appears.

Is that the type of thing this is for?</description>
		<content:encoded><![CDATA[<p>Is this still a recommended way to do this?  I&#8217;m not really a javascript expert, but what I&#8217;m looking for is a way to dump a preloader on the page while the whole DOM is loading and after it&#8217;s loaded and all the onload javascript is executed the preloader goes away and the rest of the content appears.</p>
<p>Is that the type of thing this is for?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron N.</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-9699</link>
		<dc:creator>Aaron N.</dc:creator>
		<pubDate>Fri, 27 Apr 2007 17:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-9699</guid>
		<description>How odd. It&#039;s not part of Prototype. Well, here&#039;s the original code:

[js]/* -- DOM READY http://www.vivabit.com/bollocks/2006/06/21/a-dom-ready-extension-for-prototype  -- */
try {
	Object.extend(Event, {
		_domReady : function() {
			if (arguments.callee.done) return;
			arguments.callee.done = true;
			if (this._timer) clearInterval(this._timer);
			this._readyCallbacks.each(function(f) { f() });
			this._readyCallbacks = null;
		},
		onDOMReady : function(f) {
			if (!this._readyCallbacks) {
				var domReady = this._domReady.bind(this);
				if (document.addEventListener) document.addEventListener(&quot;DOMContentLoaded&quot;, domReady, false);
				/*@cc_on @*/
				/*@if (@_win32)
					document.write(&quot;&lt;script id=__ie_onload defer src=javascript:void(0)&gt;&lt;\/script&gt;&quot;);
					document.getElementById(&quot;__ie_onload&quot;).onreadystatechange = function() {
						if (this.readyState == &quot;complete&quot;) domReady(); 
					};
				/*@end @*/
				if (/WebKit/i.test(navigator.userAgent)) {
					this._timer = setInterval(function() {
						if (/loaded&#124;complete/.test(document.readyState)) domReady();
					}, 10);
				}
				Event.observe(window, &#039;load&#039;, domReady);
				Event._readyCallbacks =  [];
			}
			Event._readyCallbacks.push(f);
		}
	});
} catch(e) {
}[/js]

I offer it here because the original url is a 404 now. I do not offer any support for it, nor guarantee that it works with the current version of Prototype.</description>
		<content:encoded><![CDATA[<p>How odd. It&#8217;s not part of Prototype. Well, here&#8217;s the original code:</p>
<p>[js]/* &#8212; DOM READY <a href="http://www.vivabit.com/bollocks/2006/06/21/a-dom-ready-extension-for-prototype" rel="nofollow">http://www.vivabit.com/bollocks/2006/06/21/a-dom-ready-extension-for-prototype</a>  &#8212; */<br />
try {<br />
	Object.extend(Event, {<br />
		_domReady : function() {<br />
			if (arguments.callee.done) return;<br />
			arguments.callee.done = true;<br />
			if (this._timer) clearInterval(this._timer);<br />
			this._readyCallbacks.each(function(f) { f() });<br />
			this._readyCallbacks = null;<br />
		},<br />
		onDOMReady : function(f) {<br />
			if (!this._readyCallbacks) {<br />
				var domReady = this._domReady.bind(this);<br />
				if (document.addEventListener) document.addEventListener(&#8220;DOMContentLoaded&#8221;, domReady, false);<br />
				/*@cc_on @*/<br />
				/*@if (@_win32)<br />
					document.write(&#8220;<script id=__ie_onload defer src=javascript:void(0)>< \/script>");
					document.getElementById("__ie_onload").onreadystatechange = function() {
						if (this.readyState == "complete") domReady(); 
					};
				/*@end @*/
				if (/WebKit/i.test(navigator.userAgent)) {
					this._timer = setInterval(function() {
						if (/loaded|complete/.test(document.readyState)) domReady();
					}, 10);
				}
				Event.observe(window, 'load', domReady);
				Event._readyCallbacks =  [];
			}
			Event._readyCallbacks.push(f);
		}
	});
} catch(e) {
}[/js]</p>
<p>I offer it here because the original url is a 404 now. I do not offer any support for it, nor guarantee that it works with the current version of Prototype.</script></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Len</title>
		<link>http://www.clientcide.com/code-snippets/event-scripting/a-dom-ready-extension-for-prototype/comment-page-1/#comment-9695</link>
		<dc:creator>Len</dc:creator>
		<pubDate>Fri, 27 Apr 2007 15:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/?p=123#comment-9695</guid>
		<description>If you know what that method is for Prototype, please inform me. I have been looking through the documentation and have not found it.</description>
		<content:encoded><![CDATA[<p>If you know what that method is for Prototype, please inform me. I have been looking through the documentation and have not found it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
