使用blueimp tmpl渲染JSON数据

时间:2018-09-14 08:51:33

标签: javascript json

我需要一些帮助,使用blueimp tmpl将JSON数据呈现为HTML。 (https://github.com/blueimp/JavaScript-Templates

This is the JSON file that i have: https://pastebin.com/8Ayymf2G

这是JavaScript行:   document.getElementById(“ side-events”)。innerHTML = tmpl(“ side-event-game-template”,matchData);

这是HTML代码:

<script type="text/x-tmpl" id="side-event-game-template">
    <table>
     <tbody>
      <tr>
       <td>{%=o.EVS[0].DA%}</td>
      </tr>
    </tbody>
    </table>

我的问题是:

  1. 如何在td中重复JSON数据?

  2. 如何从JSON数据“ SID”中选择?

0 个答案:

没有答案