在屏幕上,我可以输出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>
这是一个codepen:http://codepen.io/bigheed/pen/OMpOza?editors=001
答案 0 :(得分:0)
我更改了这两行及其作品,
preUpdate