Podem me ajudar a entender onde esta o erro?
function atualizaLista(id_leilao) {
if (id_leilao) {
$.ajax({
url: 'get.php',
dataType: 'json',
type: 'POST',
data: 'id_leilao=' + id_leilao,
global: false,
success: function (data) {
for (i = 0; i < data.histories.length; i++) {
biddingusername = data.histories[i].history.username;
biddingprice = data.histories[i].history.bprice;
biddingtime = data.histories[i].history.time;
document.getElementById('bid_user_name_' + i).innerHTML = biddingusername;
document.getElementById('bid_price_' + i).innerHTML = 'R$' + biddingprice;
document.getElementById('bid_time_' + i).innerHTML = biddingtime;
}
}, error: function (XMLHttpRequest, textStatus, errorThrown) {
}
}); // fim ajax
} // fim if
}
Uncaught TypeError: Cannot set property 'innerHTML' of null
Informa que é nessa linha:
document.getElementById('bid_user_name_' + i).innerHTML = biddingusername;
HTML:
<tr class="producthisrow">
<td align="center" id="bid_user_name_<?= $q; ?>"></td>
<td align="center" id="bid_price_<?= $q; ?>"></td>
<td align="center" id="bid_time_<?= $q; ?>"></td>
</tr>