Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/07/2011, 08:00
caguayo
 
Fecha de Ingreso: abril-2011
Mensajes: 41
Antigüedad: 13 años
Puntos: 0
Textarea+array

Hola, buenos días.
Estoy intentando mostrar un array dentro de un textarea y lo más que he conseguido es mostrar el array con todos sus tags.

Código Javascript:
Ver original
  1. function buscarReg() {
  2.         if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  3.         var xml = xmlhttp.responseXML;
  4.         var ges = xml.getElementsByTagName('gestiones'); //es el nombre del tag xml que contiene el array
  5.         var textAreaGest = document.getElementById('gest'); //es el textarea donde mostrare el array
  6.           for(f=0; f<ges.length; f++) {
  7.                  textAreaGest.innerHTML = xmlhttp.responseText    
  8.                 //textAreaGest.appendChild = gest.responseText
  9.                
  10.           }
  11.         }
  12. }

El contenido del array viene dentro de los tags...

<informacion>
<gestiones>registro1</gestiones>
<gestiones>registro2</gestiones>
<gestiones>registro3</gestiones>
<gestiones>registro4</gestiones>
<gestiones>registro5</gestiones>
<gestiones>registro6</gestiones>
<gestiones>etc...</gestiones>
</informacion>

Muchas gracias.