title: problems executing a jquery ajax call within a function
body: <p>I would like to put an ajax call within a function since I use it repeatedly in multiple locations.  I want a manipulated version of the response returned.  Here's what I'm trying to do (greatly simplified).</p>
  
  <pre><code>a = getAjax();
  $('body').append('&lt;div&gt;'+a+'&lt;/div&gt;');
  function getAjax() {
    $.ajax({
     type: "GET",
     url: 'someURL',
     success: function(response) {
       return response;
    });
  }
  </code></pre>
  
  <p>What's happening, however, is that the append function is running before "a" has been defined in the getAjax function. Any thoughts?</p>