I need to execute a jQuery Get()
inside another, but I can not do it at all, it simply ignores the second Get()
without returning what I need (the username of the second get()
):
$.getJSON("https://api.mercadolibre.com/users/" + minha_id + "/order_blacklist?access_token=" + access_token, function(data){
var employee_data ='';
for (var i = 0; i < data.length; i++) {
employee_data += '<tr>';
$.getJSON("https://api.mercadolibre.com/users/" + data[i].user.id + "?access_token=" + access_token, function(valor){
username = valor.nickname;
employee_data += "<td>" + username + "</td>";
});
employee_data += '<td>' + data[i].user.id + '</td>';
employee_data += '<td>' + data[i].user.blocked + '</td>';
employee_data += '</tr>';
$('#employeed_table').append(employee_data);
}
});