title: Do I have to define a js function before another function uses it if they are both enclosed in another function?
body: <p>I have the following code:</p>
  
  <pre><code>    doAjax = function () {
          $.ajax({
              cache: false,
              url: url,
              dataType: 'html'
          })
          .done(onDone)
          .fail(onFail)
          .always(function () {
              ;
          });
      },
      onDone = function (data) {
          content = data;
          if (content.match(/^[eE]rror/)) {
              mvcOnFailure(content);
          } else {
  </code></pre>
  
  <p>I am getting errors with jslint saying things like "onDone" is used before it is defined. Is this something I should try to avoid, is this a problem. Note that both the doAjax and onDone functions are both enclosed inside another function.</p>