12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- 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()
|