title: Javascript return not breaking out of function
body: <p>I have a javascript function which checks to see if an artist exists in an XML file:</p>
  
  <pre><code>function artistExists(artist) {
  // get data from artists.xml 
  $('.loading').show();
  $.get(artists_xml, function(xml){  
      $('.loading').hide();
      $(xml).find('artist').each(function(){
          if ($(this).find("ar_artist").text() == artist.val()) {
              alert ('artist exists');
              return true;
          } //end if
      });  // end each
      alert ('artist does not exist');
      return false;
  }); // end .get function
  } // end of artistExists function
  </code></pre>
  
  <p>Am I right in thinking that the 'return true' line should quit execution of the function? I thought it would, but after finding a record and running the first alert execution continues to the failure alert at the bottom.</p>
  
  <p>What am I doing wrong please? Thank you.</p>