Я хочу отображать данные из API в таблицу HTML через Jquery, но данные не отображаются в таблице.Я полагаю, что это связано со структурой JSON. Вот HTML-файл
<thead>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
</thead>
<tbody id="mydata">
<tr>
<td>[[E]]</td>
<td>[[F]]</td>
<td>[[G]]</td>
</tr>
</tbody>
</table>
</div>
<script>
function UserAction() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
alert(this.responseText);
}
};
xhttp.open("GET", "https:xxxxxxx", true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1Nixxxxxxx");
}
$("#mydata").mirandajs(xhhtp);
</script>
Об ответе JSON. Я хочу получить Player, метку времени и причину и отобразить данные в таблицу (в примереE, F, G) вот ответ API
{
"meta": {
"active": 2,
"expired": 275,
"total": 277
},
"links": {
"next": "https://api.xxxxxxx"
},
"data": [
{
"type": "xxx",
"id": "xxxx",
"meta": {
"player": "Serbo"
},
"attributes": {
"id": "xxxx",
"uid": "xxxx",
"timestamp": "2018-07-11T13:02:14.663Z",
"reason": "xxxxxxx",
"note": null,
"identifiers": [
{
"id": xxxxxxx,
"type": "xxxxxxx",
"identifier": "xxxxxxx",
"private": true,
"lastSeen": "2018-08-17T16:23:24.865+00:00"
}
]
Обратите внимание, что мне нужны данные внутри объекта json, а затем данные внутри объекта атрибутов