<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='docs.xsl'?>
<docs>
<method cat='Events' type='jQuery' short='Bind a function to be executed whenever the DOM is ready to be
traversed and manipulated.' name='ready'>
<desc>Bind a function to be executed whenever the DOM is ready to be
traversed and manipulated. This is probably the most important 
function included in the event module, as it can greatly improve
the response times of your web applications.

In a nutshell, this is a solid replacement for using window.onload, 
and attaching a function to that. By using this method, your bound function 
will be called the instant the DOM is ready to be read and manipulated, 
which is when what 99.99% of all JavaScript code needs to run.

There is one argument passed to the ready event handler: A reference to
the jQuery function. You can name that argument whatever you like, and
can therefore stick with the $ alias without risk of naming collisions.

Please ensure you have no code in your &lt;body&gt; onload event handler, 
otherwise $(document).ready() may not fire.

You can have as many $(document).ready events on your page as you like.
The functions are then executed in the order they were added.</desc>
<see>$.noConflict()</see>
<see>$(Function)</see>
<params type='Function' name='fn'>
<desc>The function to be executed when the DOM is ready.</desc>
</params>
<examples>
<code>$(document).ready(function(){ Your code here... });</code>
</examples>
<examples>
<desc>Uses both the [[Core#.24.28_fn_.29|shortcut]] for $(document).ready() and the argument
to write failsafe jQuery code using the $ alias, without relying on the
global alias.</desc>
<code>jQuery(function($) {
  // Your code using failsafe $ alias here...
});</code>
</examples>
</method></docs>
