欢迎来到伍佰万足球比赛比分速报。在这里,您可以快速了解最新足球比赛的动态。
正在进行的比赛
即将开始的比赛
-
球队5
球队6
19:00
-
球队7
球队8
20:00
已结束的比赛
-
球队9
3
1
球队10
-
球队11
0
4
球队12
<script>
// 定时刷新页面,间隔10秒setInterval(function() {location.reload();}, 10000);// 处理比赛数据,更新页面内容function updateMatches(data) {var matches = data.matches;// 正在进行的比赛var ongoingMatches = document.querySelector("matches > h2:first-of-type + ul");ongoingMatches.innerHTML = "";for (var i = 0; i < matches.length; i++) {var match = matches[i];if (match.status === "in progress") {ongoingMatches.appendChild(createMatchElement(match));}}// 即将开始的比赛var upcomingMatches = document.querySelector("matches > h2:nth-of-type(2) + ul");upcomingMatches.innerHTML = "";for (var i = 0; i < matches.length; i++) {
var match = matches[i];if (match.status === "upcoming") {upcomingMatches.appendChild(createMatchElement(match));}}// 已结束的比赛var finishedMatches = document.querySelector("matches > h2:last-of-type + ul");finishedMatches.innerHTML = "";for (var i = 0; i < matches.length; i++) {var match = matches[i];if (match.status === "finished") {finishedMatches.appendChild(createMatchElement(match));}}}// 创建比赛元素function createMatchElement(match) {var li = document.createElement("li");// 球队1var team1 = document.createElement("span");team1.classList.add("team1");team1.innerText = match.team1_name;li.appendChild(team1);// 比分var score = document.createElement("span");score.classList.add("score");score.innerText = match.team1_score;li.appendChild(score);// 中划线var hyphen = document.createElement("span");hyphen.innerText = "-";li.appendChild(hyphen);// 比分var score = document.createElement("span");score.classList.add("score");score.innerText = match.team2_score;li.appendChild(score);// 球队2var team2 = document.createElement("span");team2.classList.add("team2");team2.innerText = match.team2_name;li.appendChild(team2);return li;}
</script>