when do you need to use $(document).ready()?
<p>I'm curious what situations exactly require the use of jquery's $(document).ready() or prototype's dom:loaded or any other variant of a handler for this event.</p>

<p>In all the browsers i've tested, it's entirely acceptable to begin interacting with html elements and the DOM immediately after the closing tag. (e.g.</p>

<pre><code>&lt;div id="myID"&gt;
 My Div
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
$('#myID').initializeElement();
&lt;/script&gt;
</code></pre>

<p>So at this point i'm wondering whether $(document).ready() is merely there to reduce the thinking involved in writing javascript code that runs during page load. In the case of using $(doucment).ready() there is regularly rendering issues such as popping and 'artifacts' between the browser first starting to draw the page and the javascript actually executing when the page is 'ready'.</p>

<p>Are there any scenarios where $(document).ready() is required?</p>

<p>Are there any reasons I shouldn't be writing initialization scripts as demonstrated?</p>
