Reputation: 435
I am using JSON stringify, here is my code:
var lista={};
for(var i=0; i < arr.length; i++){
lista[i]=[];
//lista[i].push('imagen:'+arr[i].id);
lista[i].push('nick:'+arr[i].nick);
lista[i].push('tlfno:'+arr[i].tlfno);
lista[i].push('nombre:'+arr[i].nombre);
lista[i].push('descripcion:'+arr[i].descripcion);
lista[i].push('direccion:'+arr[i].direccion);
lista[i].push('fecha:'+arr[i].fecha);
lista[i].push('estado:'+arr[i].estado);
lista[i].push('tipoimagen:'+arr[i].tipoimagen);
//lista[i].push('imagen:'+arr[i].imagen);
}
var json = JSON.stringify(lista);
console.log(json);
I am getting this output:
{"0":["nick:pepe","tlfno:678909897","nombre:dsfdfsf","descripcion:dsdsdsd","direccion:fdfdf","fecha:fdfdf","estado:1","tipoimagen:image/jpeg"]
but is wrong because it would be like this:
{"0":["nick":"pepe"
with double quotes, somebody knows how to show this double quote? Thanks
Upvotes: 0
Views: 927