$.ajax({ async: false, url: '', type: 'GET', succes:function(response) { errors[errors.length] = response; } });