JSFiddle - React, Tailwind, and code Playground
by Danny Michaelis
JavaScript
$(function () {
var params = {
key: 'EE150EDD-E37B-45FA-B2FE-A250B759FF11',
};
var teams = [“ARI", "ATL", "BAL", "BUF", "CAR", "CHI", "CIN", "CLE", "DAL", "DEN", "DET", "GB", "HOU", "IND", "JAX", "KC", "MIA", "MIN", "NE", "NO", "NYG", "NYJ", "OAK", "PH", "PIT", "SD", "SEA", "SF", "STL", "TB", "TEN", "WAS”];
for (var index = 0; index < teams.length; index++) {
var teamAberviation = teams[index];
$.ajax({
// Specify values for path parameters (shown as {...})
url: "http://api.nfldata.apiphany.com/trial/json/Players/"+teamAberviation+?" + $.param(params),
type: 'GET',
"crossDomain": true,
"dataType": " jsonp",
"success": function (data) {
var playerlist = [];
for (var index = 0; index < data.length; index++) {
var playerObject = data[index];
var playerName = playerObject.FirstName + " " + playerObject.FirstName
playerlist.push(playerName);
}
console.log(teamAberviation);
console.log(playerlist)
}
});
}
});