title: Proper way to work with jQuery inside of a function?
body: <p>I know the question is pretty subjective, but I'm sure I'm not following standards on this one - as while styles and approaches may differ to development, there are some pretty solid standards.</p>
  
  <p>Anyway, when defining a function in javascript that uses the jQuery library, I usually do the following;</p>
  
  <pre><code>function funcName() {
      $(document).ready(function() {
           // Do stuff
      });
  }
  </code></pre>
  
  <p>Attempting to do this in order to use jQuery inside of a function hasn't worked for me, hence why I'm using the above;</p>
  
  <pre><code>$(document).ready(function() {
       function funcName() {
           // Do stuff
       }
  });
  </code></pre>
  
  <p>Any comments/answers on the standards compliant/common way to use jQuery within a function would be very much appreciated!</p>
  
  <p><strong>Edit:</strong> A remarkable level of stupidity caused me to ask this question. Since I started using jQuery (before I really even understood anything about development), I'd always encased my code in <code>$(document).ready(function{})</code>, not thinking about it's actual purpose.</p>
  
  <p>If you want to vote to close this, please do.</p>