- Rankings
- World Cup
- EURO
-
- Copa America
- Champions League
- Europa League
- Europa Conference League
- Premier League
- Bundesliga
- LaLiga
- Ligue 1
- Serie A
- Eredivisie
- Super Lig
- < Back
- International
- England
- Germany
- Spain
- France
- Italy
- Netherlands
- Turkiye
- Albania
- Algeria
- Andorra
- Angola
- Argentina
- Armenia
- Australia
- Austria
- Azerbaijan
- Bahrain
- Belarus
- Belgium
- Bolivia
- Bosnia And Herzegovina
- Botswana
- Brazil
- Bulgaria
- Burkina Faso
- Burundi
- Cameroon
- Canada
- Chile
- China
- Colombia
- Costa Rica
- Croatia
- Cuba
- Cyprus
- Czechia
- Democratic Republic Of The Congo
- Denmark
- Ecuador
- Egypt
- El Salvador
- Estonia
- Faroe Islands
- Finland
- Gabon
- Georgia
- Ghana
- Gibraltar
- Greece
- Guatemala
- Honduras
- Hong Kong
- Hungary
- Iceland
- India
- Indonesia
- Iran
- Iraq
- Ireland
- Israel
- Ivory Coast
- Jamaica
- Japan
- Jordan
- Kazakhstan
- Kenya
- Kosovo
- Kuwait
- Latvia
- Lebanon
- Liechtenstein
- Lithuania
- Luxembourg
- Malaysia
- Malta
- Mexico
- Moldova
- Montenegro
- Morocco
- Mozambique
- Myanmar
- New Zealand
- Nicaragua
- Nigeria
- North Macedonia
- Northern Ireland
- Norway
- Oman
- Palestine
- Panama
- Paraguay
- Peru
- Philippines
- Poland
- Portugal
- Qatar
- Romania
- Russia
- San Marino
- Saudi Arabia
- Scotland
- Serbia
- Singapore
- Slovakia
- Slovenia
- South Africa
- South Korea
- Sweden
- Switzerland
- Syria
- Taiwan
- Tajikistan
- Tanzania
- Thailand
- Tunisia
- Turkmenistan
- Usa
- Uganda
- Ukraine
- United Arab Emirates
- Uruguay
- Uzbekistan
- Venezuela
- Vietnam
- Wales
- Yemen
- Zambia
- Zimbabwe
- SHOW MORE
Overview Standings Results Fixtures Squad
'; let homeTeamURL = teamUpcomingEvents[0].home[0].name.replace(/ /g, "-").replace('/', '!').toLowerCase(); let awayTeamURL = teamUpcomingEvents[0].away[0].name.replace(/ /g, "-").replace('/', '!').toLowerCase(); let curMatchDate = teamUpcomingEvents[0].start.split("T")[0]; let linkMatchDate = curMatchDate.split("-")[2] + "-" + curMatchDate.split("-")[1] + "-" + curMatchDate.split("-")[0]; let eventLink = "/" + options.sportName + "/match/" + homeTeamURL + "-vs-" + awayTeamURL + "/" + linkMatchDate + "/" + teamUpcomingEvents[0].id; nextEventHTML += '
'; nextEventHTML += '' + teamUpcomingEvents[0].stageName + ': '; nextEventHTML += !isNaN(teamUpcomingEvents[0].roundName) ? 'Round ' + teamUpcomingEvents[0].roundName : teamUpcomingEvents[0].roundName; nextEventHTML += ''; nextEventHTML += ''; let homeTeamLogo = 'https://img.xscores.com/participant/' + teamUpcomingEvents[0].home[0].image.type + '/' + teamUpcomingEvents[0].home[0].image.names[0] + '/' + teamUpcomingEvents[0].home[0].image.id; nextEventHTML += '' + teamUpcomingEvents[0].home[0].name + ''; let match_start_date = new Date(teamUpcomingEvents[0].start); let match_ko_hour = match_start_date.getHours(); let match_ko_minutes = match_start_date.getMinutes(); if (match_ko_hour < 10) match_ko_hour = '0' + match_ko_hour; if (match_ko_minutes < 10) match_ko_minutes = '0' + match_ko_minutes; let matchKickOff = match_ko_hour + ':' + match_ko_minutes; // Define an array of month names let formattedDate; if (!isToday(match_start_date)) { const months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; formattedDate = months[match_start_date.getMonth()] + ' ' + match_start_date.getDate() + ', ' + match_start_date.getFullYear(); } else { formattedDate = "Today"; } nextEventHTML += '' + matchKickOff + '' + formattedDate + ''; let awayTeamLogo = 'https://img.xscores.com/participant/' + teamUpcomingEvents[0].away[0].image.type + '/' + teamUpcomingEvents[0].away[0].image.names[0] + '/' + teamUpcomingEvents[0].away[0].image.id; nextEventHTML += '' + teamUpcomingEvents[0].away[0].name + ''; nextEventHTML += ''; next_event_wrapper.innerHTML = nextEventHTML; overview_content_wrapper.appendChild(next_event_wrapper); } // Create Team Form Section if (options.team.form.length > 0) { let team_form_wrapper = document.createElement("div"); team_form_wrapper.setAttribute("class", "team_form_wrapper"); let teamFormHTML = '
'; teamFormHTML += '
'; let teamFormEvents = options.team.form.reverse(); teamFormEvents = teamFormEvents.slice(0, Math.min(options.team.form.length, 5)); for (let idx = 0; idx < teamFormEvents.length; idx++) { let eventResult = teamFormEvents[idx].value.toUpperCase(); teamFormHTML += '
' + eventResult + '
'; } teamFormHTML += '
'; teamFormHTML += '
'; for (let idx = 0; idx < teamFormEvents.length; idx++) { let homeTeamURL = teamFormEvents[idx].homeParticipantName.replace(/ /g, "-").replace('/', '!').toLowerCase(); let awayTeamURL = teamFormEvents[idx].awayParticipantName.replace(/ /g, "-").replace('/', '!').toLowerCase(); let curMatchDate = teamFormEvents[idx].eventDate.split("T")[0]; let linkMatchDate = curMatchDate.split("-")[2] + "-" + curMatchDate.split("-")[1] + "-" + curMatchDate.split("-")[0]; let eventLink = "/" + options.sportName + "/match/" + homeTeamURL + "-vs-" + awayTeamURL + "/" + linkMatchDate + "/" + teamFormEvents[idx].eventId; teamFormHTML += ''; let homeTeamLogo = 'https://img.xscores.com/participant/logo/teamlogo/' + teamFormEvents[idx].homeParticipantId; teamFormHTML += ''; let eventResult = teamFormEvents[idx].result.split(":"); teamFormHTML += (eventResult[0] > eventResult[1]) ? '' + eventResult[0] + ' - ' + eventResult[1] + '' : (eventResult[0] < eventResult[1]) ? '' + eventResult[0] + ' - ' + eventResult[1] + '' : '' + eventResult[0] + ' - ' + eventResult[1] + ''; let awayTeamLogo = 'https://img.xscores.com/participant/logo/teamlogo/' + teamFormEvents[idx].awayParticipantId; teamFormHTML += ''; teamFormHTML += ''; } teamFormHTML += '
'; team_form_wrapper.innerHTML = teamFormHTML; overview_content_wrapper.appendChild(team_form_wrapper); } // Create Team Information Section let team_info_wrapper = document.createElement("div"); team_info_wrapper.setAttribute("class", "team_info_wrapper"); let teamInfoHTML = '
'; teamInfoHTML += '
'; let teamCountryLogo = 'https://newmedia.xscores.com/flat_android/' + options.team.countryName.toLowerCase() + '.png'; teamInfoHTML += '
'; if (options.team.homePage != null) { teamInfoHTML += '
' + options.team.homePage.replace('http://', '').replace('https://', '') + '
'; } if (options.team.coach != null) { let coachCountryLogo = 'https://newmedia.xscores.com/flat_android/' + options.team.coach.countryName.toLowerCase() + '.png'; teamInfoHTML += '
'; } if (options.team.squadSize != null) { teamInfoHTML += '
'; } if (options.team.averageAge != null) { teamInfoHTML += '
'; } if (options.team.totalForeignPlayers != null && !options.team.isNationalTeam) { teamInfoHTML += '
'; } teamInfoHTML += '
'; team_info_wrapper.innerHTML = teamInfoHTML; overview_content_wrapper.appendChild(team_info_wrapper); // Create Team Venue Information Section if (options.team.venue != null) { let team_venue_info_wrapper = document.createElement("div"); team_venue_info_wrapper.setAttribute("class", "venue_info_wrapper"); let teamVenueInfoHTML = '
'; teamVenueInfoHTML += '
'; const lng = options.team.venue.details.find(p => p.name === "Longitude"); const lat = options.team.venue.details.find(p => p.name === "Latitude"); if (lng && lat) { let teamVenueLink = "https://maps.google.com/?q=" + lat.value + "," + lng.value; teamVenueInfoHTML += '
' + options.team.venue.venueName + '
'; } const venueCapacity = options.team.venue.details.find(p => p.name === "Capacity"); if (venueCapacity) { teamVenueInfoHTML += '
'; } const venueConstructionCost = options.team.venue.details.find(p => p.name === "Construction cost"); if (venueConstructionCost) { teamVenueInfoHTML += '
'; } const venueDimensions = options.team.venue.details.find(p => p.name === "Field dimensions"); if (venueDimensions) { teamVenueInfoHTML += '
'; } const venueCity = options.team.venue.details.find(p => p.name === "City"); if (venueCity) { teamVenueInfoHTML += '
'; } else { teamVenueInfoHTML += '
'; } teamVenueInfoHTML += '
'; team_venue_info_wrapper.innerHTML = teamVenueInfoHTML; overview_content_wrapper.appendChild(team_venue_info_wrapper); } // Create Team Upcoming Events Section if (teamUpcomingEvents.length > 0) { // Create Team Information Section let upcoming_events_wrapper = document.createElement("div"); upcoming_events_wrapper.setAttribute("class", "upcoming_events_wrapper"); let upcomingEventsHTML = '
'; upcomingEventsHTML += '
'; upcoming_events_wrapper.innerHTML = upcomingEventsHTML; overview_content_wrapper.appendChild(upcoming_events_wrapper); } docFrag.appendChild(overview_content_wrapper); document.querySelectorAll(".content_wrapper")[0].appendChild(docFrag); // Append Team Upcoming Events if (teamUpcomingEvents.length > 0) { new TeamMatchList({ teamId: options.team.id, teamName: options.team.name, countryName: options.team.countryName, season: options.latestSeason, displayType: "upcoming", clearContent: true, showHeaders: false, appendTo: document.querySelectorAll(".upcoming_events_container")[0] }); } } async function showTeamResults() { // Get Team Information and Seasons await getTeamSeasons(); await getTeamInformation(); document.getElementsByClassName("content_wrapper")[0].style.display = "block"; document.getElementsByClassName("standings_wrapper")[0].style.display = "none"; new TeamMatchList({ teamId: options.team.id, teamName: options.team.name, countryName: options.team.countryName, season: options.selectedSeason, displayType: "results", clearContent: true, appendTo: document.querySelectorAll(".content_wrapper")[0] }); } async function showTeamFixtures() { // Get Team Information and Seasons await getTeamSeasons(); await getTeamInformation(); document.getElementsByClassName("content_wrapper")[0].style.display = "block"; document.getElementsByClassName("standings_wrapper")[0].style.display = "none"; new TeamMatchList({ teamId: options.team.id, teamName: options.team.name, countryName: options.team.countryName, season: options.selectedSeason, displayType: "fixtures", clearContent: true, appendTo: document.querySelectorAll(".content_wrapper")[0] }); } async function showTeamStandings() { // Get Team Information and Seasons await getTeamSeasons(); await getTeamInformation(); // Get Team Competitions await getTeamCompetitions(); document.getElementsByClassName("content_wrapper")[0].style.display = "none"; document.getElementsByClassName("standings_wrapper")[0].style.display = "block"; await updateTeamStandings(); } async function updateTeamStandings() { if (options.teamCompetitions.length > 0 && options.selectedCompetition != null) { // Add Team Standings await new LeagueStandings({ sportName: "soccer", leagueCode: options.selectedCompetition.id, parentCode: "", parentLeague: false, displayShowAllGroupsBtn: false, standingType: 'ligatable', tableType: "total", countryName: options.selectedCompetition.countryName, leagueName: options.selectedCompetition.name, season: options.selectedSeason, availableStandings: { live: false, regular: true, }, appendTo: document.querySelectorAll(".standings_content")[0] }); } else { let standings_content_wrapper = '
'; standings_content_wrapper += "" standings_content_wrapper += '
'; document.querySelectorAll(".standings_content")[0].innerHTML = standings_content_wrapper; } } async function showPlayerStatistics() { // Get Team Information and Seasons await getTeamSeasons(); await getTeamInformation(); // Get Team Competitions await getTeamCompetitions(); document.getElementsByClassName("content_wrapper")[0].style.display = "none"; document.getElementsByClassName("standings_wrapper")[0].style.display = "block"; await updatePlayerStats(); } async function updatePlayerStats() { } async function showTeamSquad() { // Get Team Information and Seasons await getTeamSeasons(); await getTeamInformation(); document.getElementsByClassName("content_wrapper")[0].style.display = "block"; document.getElementsByClassName("standings_wrapper")[0].style.display = "none"; // Retrieve Team's Squad Information let teamSquad = await makeAjaxCall(apiURL + "/v1/json/participants/" + options.team.id + "/squad?language-type=3&tournament-name=" + options.latestSeason, "GET"); if ((teamSquad.coach && teamSquad.coach.length > 0) || (teamSquad.keeper && teamSquad.keeper.length > 0) || (teamSquad.defender && teamSquad.defender.length > 0) || (teamSquad.midfielder && teamSquad.midfielder.length > 0) || (teamSquad.forward && teamSquad.forward.length > 0) // Basketball specific || (teamSquad.center && teamSquad.center.length > 0) || (teamSquad.guard && teamSquad.guard.length > 0) || (teamSquad["point guard"] && teamSquad["point guard"].length > 0) || (teamSquad["shooting guard"] && teamSquad["shooting guard"].length > 0) || (teamSquad["small forward"] && teamSquad["small forward"].length > 0) || (teamSquad["power forward"] && teamSquad["power forward"].length > 0) // Hockey specific || (teamSquad.goaltender && teamSquad.goaltender.length > 0) || (teamSquad.defenceman && teamSquad.defenceman.length > 0) // Baseball specific || (teamSquad.starter && teamSquad.starter.length > 0) || (teamSquad.catcher && teamSquad.catcher.length > 0) || (teamSquad.infield && teamSquad.infield.length > 0) || (teamSquad["center outfield"] && teamSquad["center outfield"].length > 0) || (teamSquad.outfield && teamSquad.outfield.length > 0) || (teamSquad.pitcher && teamSquad.pitcher.length > 0) || (teamSquad.reliever && teamSquad.reliever.length > 0) || (teamSquad.shortstop && teamSquad.shortstop.length > 0) || (teamSquad["third base"] && teamSquad["third base"].length > 0) ) { let docFrag = document.createDocumentFragment(); let squad_content_wrapper = document.createElement("div"); squad_content_wrapper.setAttribute("class", "squad_wrapper_container"); // Coach if (teamSquad.coach && teamSquad.coach.length > 0) { let coach_info_wrapper = document.createElement("div"); coach_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var coachInfoHTML = '
'; coachInfoHTML += '
'; teamSquad.coach.forEach(player => { if (!player.active) return; let coachAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + options.team.coach.countryName.toLowerCase() + '.png'; coachInfoHTML += '
'; coachInfoHTML += ''; coachInfoHTML += '
' + coachAge + '
'; coachInfoHTML += '
'; }); coachInfoHTML += '
'; coach_info_wrapper.innerHTML = coachInfoHTML; squad_content_wrapper.appendChild(coach_info_wrapper); } // Keepers if (teamSquad.keeper && teamSquad.keeper.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.keeper.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Defenders if (teamSquad.defender && teamSquad.defender.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.defender.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Midfielders if (teamSquad.midfielder && teamSquad.midfielder.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.midfielder.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Centers if (teamSquad.center && teamSquad.center.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.center.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Guards if (teamSquad.guard && teamSquad.guard.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.guard.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Point Guards if (teamSquad["point guard"] && teamSquad["point guard"].length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad["point guard"].forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Shooting Guards if (teamSquad["shooting guard"] && teamSquad["shooting guard"].length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad["shooting guard"].forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Small Forwards if (teamSquad["small forward"] && teamSquad["small forward"].length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad["small forward"].forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Power Forwards if (teamSquad["power forward"] && teamSquad["power forward"].length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad["power forward"].forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Goaltenders [Hockey] if (teamSquad.goaltender && teamSquad.goaltender.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.goaltender.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Defencemans [Hockey] if (teamSquad.defenceman && teamSquad.defenceman.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.defenceman.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Forwards if (teamSquad.forward && teamSquad.forward.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.forward.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Starters if (teamSquad.starter && teamSquad.starter.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.starter.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Catchers if (teamSquad.catcher && teamSquad.catcher.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.catcher.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Infields if (teamSquad.infield && teamSquad.infield.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.infield.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Center Outfields if (teamSquad["center outfield"] && teamSquad["center outfield"].length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad["center outfield"].forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Outfields if (teamSquad.outfield && teamSquad.outfield.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.outfield.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Pitchers if (teamSquad.pitcher && teamSquad.pitcher.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.pitcher.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Relievers if (teamSquad.reliever && teamSquad.reliever.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.reliever.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Shortstops if (teamSquad.shortstop && teamSquad.shortstop.length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad.shortstop.forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } // Third Base if (teamSquad["third base"] && teamSquad["third base"].length > 0) { let players_info_wrapper = document.createElement("div"); players_info_wrapper.setAttribute("class", "squad_position_players_wrapper"); var playersInfoHTML = '
'; playersInfoHTML += '
'; teamSquad["third base"].forEach(player => { if (!player.active) return; let playerAge = (player.age) ? "" : ""; let countryImageLink = 'https://newmedia.xscores.com/flat_android/' + player.countryName.toLowerCase() + '.png'; playersInfoHTML += '
'; if (player.shirtNumber != null) { playersInfoHTML += '
'; } else { playersInfoHTML += '
'; } playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
' + playerAge + '
'; playersInfoHTML += '
'; if (player.onLoanFrom != null) { let loanFromTeamLink = 'https://img.xscores.com/participant/' + player.onLoanFrom.image.type + '/' + player.onLoanFrom.image.names[0] + '/' + player.onLoanFrom.image.id; playersInfoHTML += '
'; playersInfoHTML += ''; playersInfoHTML += '
'; } playersInfoHTML += '
'; }); playersInfoHTML += '
'; players_info_wrapper.innerHTML = playersInfoHTML; squad_content_wrapper.appendChild(players_info_wrapper); } docFrag.appendChild(squad_content_wrapper); document.querySelectorAll(".content_wrapper")[0].appendChild(docFrag); } else { } } // Initialize the selected tab let winLoc = window.location.href.split("/"); let winLocLen = winLoc.length - 1; switch (winLoc[winLocLen]) { case "results": showTeamResults(); break; case "fixtures": showTeamFixtures(); break; case "standings": showTeamStandings(); break; case "player-statistics": showPlayerStatistics(); break; case "squad": showTeamSquad(); break; default: showTeamOverview(); break; }