<script>
/* 1st API*/
$.getJSON("http://cricapi.com/api/matches/?apikey=6aP8B4MImxSNxI6fevBmC2ZshO42",function(data){
var len = data.matches.length;
for(i=0;i<len;i++){
id = data.matches[i].unique_id;
ms = data.matches[i].matchStarted;
x = data.matches[i].date;
team_1 = data.matches[i]['team-1']
/* 2nd API*/
$.getJSON("https://cricapi.com/api/cricketScore/?apikey=6aP8B4MImxSNxI6fevBmC2ZshO42&unique_id="+id,function(data1){
console.log(team_1);
});
}
});
why i cannot get the team_1 of each match in second getJSON(). It is giving the output of same team name multiple times please help me to get the team names of each match. Appreciate any help!!