<link href="style.css" rel="stylesheet"/>
足球比分网为您带来足总杯的实时战况。
<script>
function updateData() {// 通过 API 获取实时比分数据fetch('api/scores').then(response => response.json()).then(data => {// 更新比分表const table = document.getElementById('table');data.scores.forEach(score => {const row = table.insertRow();const homeCell = row.insertCell();const scoreCell = row.insertCell();const awayCell = row.insertCell();homeCell.textContent = score.homeTeam;scoreCell.textContent = score.homeScore + ' - ' + score.awayScore;awayCell.textContent = score.awayTeam;});// 更新赛程表const schedule = document.getElementById('schedule');data.schedule.forEach(match => {const row = schedule.insertRow();const timeCell = row.insertCell();const homeCell = row.insertCell();const awayCell = row.insertCell();timeCell.textContent = match.time;homeCell.textContent = match.homeTeam;awayCell.textContent = match.awayTeam;});});}// 每 10 秒更新一次数据setInterval(updateData, 10000);
</script>
相关阅读: 足总杯激战正酣 足球比分网助您实时洞悉战况