即时足球比分,捷报抢先报:实时比赛,即刻了解战况

来源:24直播网
捷报抢先报 <link href="style.css" rel="stylesheet"/>

捷报抢先报:实时比赛,即刻了解战况

球队 1
0 0
球队 2
球队 3
1 0
球队 4
<script> // 定期刷新比赛比分setInterval(function() {// 获取比赛数据fetch('api/matches').then(response => response.json()).then(data => {// 更新比赛比分data.matches.forEach(match => {const matchElement = document.querySelector(`match-list .match[data-id="${match.id}"]`);matchElement.querySelector('.score span:first-child').textContent = match.score.home;matchElement.querySelector('.score span:last-child').textContent = match.score.away;});}).catch(error => {console.error('无法获取比赛数据:', error);});}, 5000); </script>