vendredi 16 décembre 2016

Ajax Request in a For Loop, Variable not getting Any Info

var names = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"]

var data1 = [];

for(var x = 0; x

var ajaxcall = $.ajax({
  type: 'GET',
  url: 'http://ift.tt/1eP7a4l'+names[x],
  headers: {
    'Client-ID': 'jasdjaklsj3w4123l343'
  },  success: function(data2){
        data1.push(data2);
    }});

}

console.log(data1); // Shows Empty Array




Aucun commentaire:

Enregistrer un commentaire