竞彩足球比分手机版:掌上实时数据,即时掌握赛果
- 发布于:2025-02-19 19:23:34
- 来源:24直播网

<style>
body {font-family: "Helvetica", "Arial", sans-serif;}.container {max-width: 600px;padding: 16px;}h1 {font-size: 24px;margin-bottom: 12px;}p {font-size: 16px;margin-bottom: 12px;}.table {width: 100%;border-collapse: collapse;}.table th,.table td {border: 1px solid ccc;padding: 4px
主队 | 客队 | 比分 |
<script>const leagueSelect = document.getElementById('league-select');const matchTable = document.getElementById('match-table');const leagues = {"epl": "英格兰超级联赛","laliga": "西班牙甲级联赛","bundesliga": "德国甲级联赛","seriea": "意大利甲级联赛","ligue1": "法国甲级联赛"};let currentLeague = 'all';function getMatches() {fetch(`${currentLeague}`).then(res => res.json()).then(data => {const matches = data.matches;// Clear the table bodyconst tbody = matchTable.querySelector('tbody');tbody.innerHTML = '';// Add rows to the tablematches.forEach(match => {const { date, homeTeam, awayTeam, score } = match;const newRow = document.createElement('tr');newRow.innerHTML = `
${date} | ${homeTeam} | ${awayTeam} | ${score} | `;tbody.appendChild(newRow);});}).catch(err => {console.error('Error fetching matches:', err);alert('获取比赛数据失败,请重试。');});}leagueSelect.addEventListener('change', e => {currentLeague = e.target.value;getMatches();});// Initial loadgetMatches();</script>