Comunidad de diseño web y desarrollo en internet online

Recorrer attributes de un nodo con un bucle

Citar            
MensajeEscrito el 03 Abr 2009 12:08 pm
Hola!

Tengo una preguntilla rápida, como recorro los atributos de un nodo??

Tengo esto:

Código :

<nodo label = "FOTO1" dirurl="Imagen1.jpg" foto1="Imagen1.jpg" foto2="Imagen1.jpg" foto3="Imagen1.jpg"/>


Me gustaría que con un bucle me devolviera lo que contiene cada atributo del nodo "FOTO1" osea que me devuelva esto:

Imagen1.jpg
Imagen2.jpg
Imagen3.jpg

Gracias!

Por cotk

61 de clabLevel



 

safari
Citar            
MensajeEscrito el 03 Abr 2009 12:27 pm
Usa un for in

Aqui un ejemplito:

Código ActionScript :

var algo:XML = new XML("<a><b uno=\"algo\" dos=\"algo\" tres=\"algo\"/></a>");
for( var i in algo.firstChild.firstChild.attributes )
   trace(i +" = "+ algo.firstChild.firstChild.attributes[i])

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox
Citar            
MensajeEscrito el 03 Abr 2009 12:34 pm
FUNCIONA!!!
YipieeeeeeeHHH!!!
Gracias LongeVie!! Ere un makina!!! :P

Por cotk

61 de clabLevel



 

safari

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.