我想使用 etherscan API 加载事件徽标。
它不会添加到引导表中。
我刚开始编码不久。对许多错误感到抱歉。
JS:
$.getJSON("https://api-ropsten.etherscan.io/api?module=logs&action=getLogs&fromBlock=379224&toBlock=latest&address=0x96604Ac7312f3ba2c0f778564F0D13bFA5A54faa&topic0=0x5436f9c7563d4b5be022d399b41f15519419cafca0f81c49d0cfbe78b925cbff&apikey=IQN5KP8AKJ9WFTYNGZRJE7W3QHXPT4S65H", function (data) {
console.log(data);
$(function () {
$('table').bootstrapTable({
data: JSON.parse(data.result)
});
});
});
HTML:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.js"></script>
<link href="https://unpkg.com/bootstrap-table@1.15.4/dist/bootstrap-table.min.css" rel="stylesheet">
<script src="https://unpkg.com/bootstrap-table@1.15.4/dist/bootstrap-table.min.js"></script>
<table
id="#table"
data-toggle="table"
data-silent-sort="false"
data-height="460"
data-pagination="true"
data-side-pagination="server"
data-url="http://api-ropsten.etherscan.io/api?module=logs&action=getLogs&fromBlock=379224&toBlock=latest&address=0x96604Ac7312f3ba2c0f778564F0D13bFA5A54faa&topic0=0x5436f9c7563d4b5be022d399b41f15519419cafca0f81c49d0cfbe78b925cbff&apikey=IQN5KP8AKJ9WFTYNGZRJE7W3QHXPT4S65H">
<thead>
<tr>
<th data-field="address" data-sortable="true">address</th>
<th data-field="data" data-sortable="true">data</th>
<th data-field="topics" data-sortable="true">topic</th>
</tr>
</thead>
</table>