Ich habe diese TabelleBestücken Tabelle mit jQuery
<table class="table table-hover">
<thead>
<tr>
<th>Person</th>
<th>Ethereum Address</th>
<th>Transaction count</th>
<th>Balance (in Wei)</th>
<th>Transaction</th>
</tr>
</thead>
<tbody>
<tr>
<td>Person 1</td>
<td class="address" id=""></td>
<td class="transaction"></td>
<td class="balance"></td>
<td class="ether"></td>
<td class="time" id=""></td>
</tr>
<tr>
<td>Person 2</td>
<td class="address" id=""></td>
<td class="transaction"></td>
<td class="balance"></td>
<td class="ether"></td>
<td class="time" id=""></td>
</tr>
<tr>
<td>Person 3</td>
<td class="address" id=""></td>
<td class="transaction"></td>
<td class="balance"></td>
<td class="ether"></td>
<td class="time" id=""></td>
</tr>
</tbody>
</table>
ich mit jQuery über den Tisch iterieren möchte und die Adressfelder (zum Beispiel) mit den entsprechenden Astraleum Adressen füllen web3.eth.accounts[i]
mit (mit meiner eigenen Adresse aus eine Testkette).
Ich habe verschiedene Möglichkeiten ausprobiert, von denen keine funktionieren. Derzeit versuche ich
$("tbody").find("tr").each(function() { //get all rows in table
$(this).find('td.address').innerText = web3.eth.accounts[0] // just trying to place account 0 to test the loop
});
basierend auf einem Stackoverflow Antwort auf ein ähnliches Problem.
Was ist falsch mit dem jQuery-Code?
[ 'innerText' ] (https://developer.mozilla.org/en-US/docs/Web/API/Node/innerText) ist nicht standardmäßige Verwendung ['textContent'] (https://developer.mozilla.org/en-US/docs/Web/API/Knoten/Textinhalt). –