title: How to return json from $.getJSON (coffeescript)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3537434/cant-get-correct-return-value-from-an-jquery-ajax-call">Can’t get correct return value from an jQuery Ajax call</a><br>
    <a href="https://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-ajax-call-from-a-function">How to return the response from an AJAX call from a function?</a>  </p>
  </blockquote>
  
  
  
  <p>I have this:</p>
  
  <pre><code>  get_json = (url) -&gt;
      $.getJSON "#{url}.json", {}, (json, response) -&gt;
        return json
  </code></pre>
  
  <p>But this compiles to:</p>
  
  <pre><code>getJson = function(url) {
    return $.getJSON("" + url + ".json", {}, function(json, response) {
      return json;
    });
  };
  </code></pre>
  
  <p>..and returns the response object. How can I return just the json instead?</p>