title: Waiting for JSON data to be parsed
body: <p>Is there a way to wait for jQuery's getJSON method?</p>
  
  <p>I want to parse the data, recieved with this function and just return false/true if a specific string is contained. But due to the asynchronous data processing this seems not to be that easy. Here is a code snippet:</p>
  
  <pre><code>contained = false;
  
  $.getJSON(URL, function ( data ) {
      $.each( data, function( i, item ) {
          if ( item.Info.code == code ) contained = true;
      });
  });
  </code></pre>
  
  <p>After thid code, the function, where this code is placed in, returns the 'contained' value, whis is basically false, because getJSON has not finished yet.</p>