$.ajax({ 'url' : settings.url, 'dataType' : 'json', 'data' : { 'tag' : currentTag.tag }, 'async' : false, // wait until this is ajax hit is complete before continue 'success' : function (m) { matches = m.matches; } });