title: jquery handle ajax response outside of ajax object
body: <p>I am working with jQuery and I need to handle the data gathered during an AJAX call outside of the AJAX object:</p>
  <pre><code>function getData(yt_url) {
      $.ajax({
          type: &quot;GET&quot;,
          url: yt_url,
          dataType: &quot;jsonp&quot;,
          success: function(response) {
              //   Return response here //
  
          },
          error: function(request, status, error) {
              alert(status);
          }
      });
  }
  </code></pre>
  <p>I would like to call the function <code>getData</code> and receive the response object in the AJAX success function.</p>
  <p>I've tried adding some returns and then of course I realized it was an object.</p>