我正在尝试配置一个制表器表以显示来自此 JSON url 的数据: https ://records.nhl.com/site/api/franchise-skater-records?cayenneExp=franchiseId=33
我的代码在下面,我试图让它在 JSON 文件中显示所有玩家的名字和助攻,非常感谢任何帮助!谢谢
HTML
<link href="https://unpkg.com/tabulator-
tables@4.0.5/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-
tables@4.0.5/dist/js/tabulator.min.js"></script>
<div id="example-table"></div>
JS
//Build Tabulator
var table = new Tabulator("#example-table", {
ajaxURL: ("https://records.nhl.com/site/api/franchise-skater-records?cayenneExp=franchiseId=29"),
height:"100px",
layout:"fitColumns",
placeholder:"Placeholder Data",
index: "id",
columns:[
{title:"Name", field:"firstName", sorter:"string"},
{title:"Assists", field:"assists", sorter:"number"},
],
});