Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/05/2012, 07:58
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: Leer array JSON con Javascript

por dios!! es frustrante ver una y otra vez lo mismo. no uses eval(), en su lugar usa json.parse()
Cita:
var types = '[{"id":1,"description":"DESC1"},{"id":2,"descriptio n":"DESC2"},{"id":3,"description":"DESC3"}]';

var z = JSON.parse(types);

for(var i in z) {
for(var j in x[i]) {
console.log(j, '-->' ,z[i][j]);
}
}
__________________
if(ViolenciaDeGénero) {alert('MUJER ASESINADA');}