var request = new XMLHttpRequest() /*request.open('GET', 'json/renglones.json', true) request.onload = function() { // begin accessing JSON data here var info = JSON.parse(this.response) var table = document.getElementById("table"); for (var i = 0; i < info.length; i++) { tr = table.insertRow(-1); for (var j = 0; j < 2; j++) { var tabCell = tr.insertCell(-1); if (j==0) { tabCell.innerHTML = info[i].Renglones; } else{ tabCell.innerHTML = info[i].Especificaciones; } } } var divContainer = document.getElementById("showData"); divContainer.innerHTML = ""; divContainer.appendChild(tr); }*/ request.open('GET', 'json/MADERA.json', true) request.onload = function() { // begin accessing JSON data here var info = JSON.parse(this.response) var table = document.getElementById("table"); for (var i = 0; i < info.length; i++) { tr = table.insertRow(-1); for (var j = 0; j < 5; j++) { var tabCell = tr.insertCell(-1); if (j==0) { tabCell.innerHTML = info[i].Nombre; } else if (j==1) { tabCell.innerHTML = info[i].Especificaciones; } else if (j==2) { tabCell.innerHTML = info[i]["Teléfono 1"]; } else if (j==3) { tabCell.innerHTML = info[i]["E-mail"]; } else{ tabCell.innerHTML = info[i].Municipio } } } var divContainer = document.getElementById("showData"); divContainer.innerHTML = ""; divContainer.appendChild(tr); } request.send()