javascript - 无法将 Ajax 数据传递到 HTML 表中
问题描述
我无法使用 ajax 将数据传递给表。如果有人能弄清楚我在哪里做错了,那就太好了。非常感谢你。
阿贾克斯成功
success: function(response){
for(i = 0; i<response.list_reports.length;i++){
console.log(response.list_reports[i])
document.getElementById("paid_bys").innerHTML = response.list_reports[i]; // Error
}
$("#rports").modal('show');
$("#rports").val(null).trigger("change");
}
控制台输出
我尝试过的表(索引):1519 未捕获的类型错误:无法设置属性“innerHTML”为空
<table class="table table-striped table-bordered base-style">
<thead>
<tr>
<th>Names</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="paid_bys"></td> //display here
</tr>
</tbody>
<tfoot>
<tr>
<th>Name</th>
</tr>
</tfoot>
</table>
解决方案
推荐阅读
- rust - 为什么我不能使用存储在结构中的线程句柄?
- java - jUnit断言类级别测试运行和jacoco代码覆盖率测试用例运行输出的预期输出中的euqals差异
- javascript - Google Chart 自定义工具提示未显示为 HTML
- shell - 如何在名称存在于另一个变量值中的变量的shell中打印环境变量值
- javascript - 我可以使用 firebase 对我的单独服务器进行授权吗?
- terraform - 遍历 terraform 中的模块
- spring-boot - 为什么swagger ui突然无法使用
- html - 我想做一个粘性侧边栏
- angular - 具有完整性和已解析字段的纱线锁定文件生成更大的 Angular 构建
- php - JSON循环未打印预期结果