using jQuery outside of $(document).ready()
<p>I have created a function outside of $(document).ready(), but am still using jQuery inside of it. For example:</p>

<pre><code>testFunction(){
  $('#test').hide();
  alert('test');
}
</code></pre>

<p>When I call testFunction() after the page has completely loaded, #test is not hidden but I do see the alert.</p>

<p>What must I do in order to use jQuery inside of this function? Thanks!</p>

<p><strong>UPDATE:</strong></p>

<p>Good to understand there are no restrictions for working outside $(document).ready().</p>

<p>Here's why it's not working: I am not calling testFunction(), I am calling parent.testFunction() from an iframe and #test is in the parent frame. So... I guess I cannot use '#test' as a selector. What should I be using?</p>
