$(document).ready called inside an external function?
<p>I saw some jquery code on the Net somewhere, that took this form :</p>

<pre><code>&lt;script&gt;            
function doSomething(message)
{   
    $(document).ready(function(){       
        alert(message);
        });
};
&lt;/script&gt;
</code></pre>

<p>i.e. an external function ("doSomething") which has $(document).ready inside it. I'm confused because isn't the code under $(document).ready triggered when the DOM is loaded ? Its like having an event handler inside a function (?). Does this form of code make sense to anyone ? Thanks.</p>
