How to run a local function from inside an jQ's AJAX request?
<pre><code>var main = {
   doSomething: function(){
      function firstOne(){}
      function secondOne(){
         $.ajax({
            success: function(){
               firstOne(); /* here I want the previous function */
            }
         });
      }
   }
}
</code></pre>

<p>How can I run the firstOne() function from the marked line? It's a noobish question perhaps, but I don't get the JS namespace (and I tried).</p>

<p>Is that kind of defining functions good from a JS good practices point of view?</p>
