I have a small problem, I am starting to program in Java, and I can not list a JSON file in a table, I have only managed to recover the json.
My json is this:
{ "alumnoUTP": [
{"nombre":"Ricardo","apePaterno":"Carpio","edad":39},
{"nombre":"Thiago","apePaterno":"Carpio","edad":5},
{"nombre":"José","apePaterno":"Carpio","edad":74} ] }
And my code is like this for the moment, I can only recover the raw data of the Json but I can not pass it to a table:
<html>
<head>
<meta charset="utf-8">
<title>Obteniendo Json</title>
</head>
<body>
<div id="datosPersona"></div>
<script>
var requestURL = 'http://localhost:8383/Semana04-2018-2/Resources/json/alumnoUTP.json';
var request = new XMLHttpRequest();
request.open('GET', requestURL);
request.responseType = 'json';
request.send();
function cargarDatos()
{
var DatosJson = request.response;
document.getElementById("datosPersona").innerHTML=DatosJson;
}
</script>
<button type="button" onclick="cargarDatos()">
Visualizar
</button>
</body>
</html>