title: Javascript function scopes
body: <p>I have function <code>bar</code> which I need to call. I'm new to using callbacks, from what I understand the callback is still inside the scope of the ajax so it can't see <code>bar</code>. Is it possible to call bar on ajax success? <code>bar</code> is defined in module <code>top</code>.</p>
  
  <pre><code>define(["top"], function() {
      function foo(callback) {
          $.ajax({
              type: "GET",
              cache: false,
              dataType: 'json',
              url: "http://asdf/qwer",
              success: function(response) {
                  callback(response);
              }
          });
      }
      foo(function(response) {
          bar(response);      
      });
  });
  </code></pre>