What is the difference between having a function in Jquery.Document and not having it in
<p>I am just wondering what is the difference between these two</p>

<pre><code>File1.js
$(function()
{
   function MyFunction()
   {
         // some code here
   }
});

File2.js

$(function()
{
      // call it.
      MyFunction();
});
</code></pre>

<p><hr /></p>

<pre><code>File1.js
function MyFunction()
{
        // some code here
}


File2.js

$(function()
{
      // call it.
      MyFunction();
});
</code></pre>

<p>So what is the difference? When I did the first way and I tried to call MyFunction() from File2.js it never worked. I moved my function out of the Jquery.Document ready in File1.Js and it worked.</p>

<p>I have some other functions that are in File1 and even though they are in document ready anything in File1 can seem to call it no problem.</p>

<p>It just seems like across script files it has a problem calling functions when setup that way.</p>
