title: jQuery getJSON - Return value to the caller function
body: <pre><code>    String.prototype.getLanguage = function() {
          $.getJSON('http://ajax.googleapis.com/ajax/services/language/detect?v=1.0&amp;q=' + this + '&amp;callback=?',
              function(json) {
                 return json.responseData.language;
              });
      };
  </code></pre>
  
  <p>How can I return the value to the caller value?
  Thanks.</p>
  
  <p><strong>EDIT:</strong> I've tried this:</p>
  
  <pre><code>    String.prototype.getLanguage = function() {
          var returnValue = null;
  
          $.getJSON('http://ajax.googleapis.com/ajax/services/language/detect?v=1.0&amp;q=' + this + '&amp;callback=?',
              function(json) {
                 returnValue = json.responseData.language;
              });
  
          return returnValue;
      };
  </code></pre>
  
  <p>But it's not working either. It returns null.</p>