Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/12/2013, 10:47
bathorz
 
Fecha de Ingreso: agosto-2013
Mensajes: 150
Antigüedad: 10 años, 8 meses
Puntos: 29
Respuesta: Problema al concatenar

Mejor concatena una variable.
Código Javascript:
Ver original
  1. <table id="tabla"></table>
  2.       <script>
  3.          var tabla = document.getElementById("tabla");
  4.          var i = 0;
  5.          var txt ="";
  6.          
  7.          for (i in location) {
  8.             txt += "<tr><td>" + i + "</td><td> = ";
  9.             if ( typeof location[i] === "string") {
  10.                txt += location[i];
  11.             } else {
  12.                txt += "No es imprimible";
  13.             }
  14.             txt += "</td></tr>";
  15.          }
  16.          tabla.innerHTML = txt;
  17.       </script>