3
I have the following JSON
[
{
"id": 1,
"nome": "Matheus Almeida Siccenna",
"cpf": null,
"matricula": {
"id": 555,
"empresa": 1,
"unidade": 0,
"descricaoUnidade": null,
"curso": 1,
"descricaoCurso": null,
"serie": 1,
"descricaoSerie": null,
"turma": 3,
"descricaoTurma": null,
"periodo": "Manhã",
"ativo": false
},
"contato": {
"email": "[email protected]",
"ddd": "41",
"telCelular": "(41)123456789",
"telResidencial": "123456789",
"telComercial": "12345-6789"
}
}
]
and I wanted to access the data with the JS
I usually make a for(i in response.content) and I’m accessing with the response.content[i].nome,
but I’m not getting it. It’s returning undefined.
Someone knows what it is?
(JSON is received via $.get)
Post your Javascript code
– Giancarlo Abel Giulian
Post as you receive this JSON, so I understand there is no error: http://jsfiddle.net/filadown/5mpw4zL1/
– Gabriel Rodrigues
What gives
alert(typeof response.content);?– Sergio