【发布时间】:2021-05-16 07:59:57
【问题描述】:
我想用 JQUERY 获取 Json 数据,但我的变量未定义。
var itech_centre='';
$.each(data, function(key,value){
itech_centre+='<tr>';
itech_centre+='<td>'+value.c_com_nom+'</td>';
itech_centre+='<td>'+value.c_adr_voie+'</br>'+value.c_com_cp+'</br>'+value.c_com_nom+'</td>';
itech_centre+='<td>'+value.c_rdv_tel+'</td>';
itech_centre+='</tr>';
});
$('#centreVaccination').append(itech_centre);
});
这是我的 HTML
<table class="table table-bordered table-striped" id="centreVaccination">
<tr>
<th>Centre</th>
<th>Adresse</th>
<th>Tel</th>
</tr>
还有我的 JSON 链接:https://www.data.gouv.fr/fr/datasets/r/d0566522-604d-4af6-be44-a26eefa01756
谢谢你的帮助!【问题讨论】:
-
我没有看到任何加载 JSON 的尝试。