今日足球比分速覽:全方位覆蓋,不容錯過

歡迎來到今日足球比分速覽!在這里,您可以獲得所有您需要知道的今日足球比賽的最新比分和信息。 <script> // 動態(tài)填充比賽數(shù)據(jù)fetch('api/matches').then(response => response.json()).then(data => {const liveMatches = data.liveMatches;const finishedMatches = data.finishedMatches;const upcomingMatches = data.upcomingMatches;// 填充正在進行的比賽數(shù)據(jù)for (let i = 0; i < liveMatches.length; i++) {const match = liveMatches[i];const row = document.createElement('tr');row.classList.add('highlight');const homeTeamCell = document.createElement('td');homeTeamCell.textContent = match.homeTeam;const scoreCell = document.createElement('td');scoreCell.textContent = match.score;const awayTeamCell = document.createElement('td');awayTeamCell.textContent = match.awayTeam;const startTimeCell = document.createElement('td');startTimeCell.textContent = match.startTime;row.appendChild(homeTeamCell);row.appendChild(scoreCell);row.appendChild(awayTeamCell);row.appendChild(startTimeCell);document.getElementById('live-matches').appendChild(row);}// 填充已結(jié)束的比賽數(shù)據(jù)for (let i = 0; i < finishedMatches.length; i++) {const match = finishedMatches[i];const row = document.createElement('tr');const homeTeamCell = document.createElement('td');homeTeamCell.textContent = match.homeTeam;const scoreCell = document.createElement('td');scoreCell.textContent = match.score;const awayTeamCell = document.createElement('td');awayTeamCell.textContent = match.awayTeam;const endTimeCell = document.createElement('td');endTimeCell.textContent = match.endTime;row.appendChild(homeTeamCell);row.appendChild(scoreCell);row.appendChild(awayTeamCell);row.appendChild(endTimeCell);document.getElementById('finished-matches').appendChild(row);}// 填充即將開始的比賽數(shù)據(jù)for (let i = 0; i < upcomingMatches.length; i++) {const match = upcomingMatches[i];const row = document.createElement('tr');const homeTeamCell = document.createElement('td');homeTeamCell.textContent = match.homeTeam;const matchTimeCell = document.createElement('td');matchTimeCell.textContent = match.matchTime;const awayTeamCell = document.createElement('td');awayTeamCell.textContent = match.awayTeam;row.appendChild(homeTeamCell);row.appendChild(matchTimeCell);row.appendChild(awayTeamCell);document.getElementById('upcoming-matches').appendChild(row);}}).catch(error => {console.error('Error fetching match data:', error);}); </script>