【发布时间】:2016-01-06 10:14:43
【问题描述】:
在屏幕上我可以输出Team:,但对应的teamName根本不输出。任何人都可以提出原因吗?
var $teams = $('#info');
var template = '<td> Team: {{standings.standing[0].teamName}} </td>';
$.ajax({
headers: {
'X-Auth-Token': '0fc841d392274cb5a26804330ac11e98'
},
type: 'GET',
dataType: 'json',
url: 'http://api.football-data.org/v1/soccerseasons/401/leagueTable',
success: function(standings) {
var output = Mustache.render(template, standings);
$teams.append(output);
}
});
<div class="container">
<table class="u-max-full-width">
<thead>
<th>Serie A</th>
<th>W</th>
<th>D</th>
<th>L</th>
<th>Goals</th>
<th>Diff</th>
<th>Pt</th>
</tr>
</thead>
<tbody>
<tr id="info"></tr>
</tbody>
</table>
</div>
【问题讨论】:
-
standings变量中返回什么数据?我们无法为您提供帮助。 -
返回的数据可以看这里api.football-data.org/v1/soccerseasons/401/leagueTablejson格式