I am creating a football website for my college project and I am using apis to pull the data on teams. On my home page I am displaying details about all teams using a jquery request.
function getTeams() {
$.ajax(
{
type: 'GET',
dataType: 'json',
url: "http://api.football-data.org/v1/competitions/426/teams",
processData: true,
success: function (data, status) {
var trHTML = '';
$.each(data.teams, function (key, item) {
//$('<option>', { text: item.TeamName, id: item.ID }).appendTo('#lstTeams');
trHTML += '<tr class="info"><td>' + item.name +
'</td><td>' + item.code +
'</td><td>' + item.shortName +
'</td><td>' + item.squadMarketValue +
'</td><td>' + item.crestURL +
'</td></tr>';
})
I would like to be able to select a team and display more details about them on another page. The trouble I am having though is there is no ID being pulled even though each team has an ID. Any idea how to grab this ID and pull it in?