4
I got this one JSON
:
{"nome_rede":"lucasl","nome":"Lucas Lima","imagem":"http:\/\/intranet.supersoft.com.br\/novo\/usuarios\/fotos\/lucasl.jpg"}
How do I catch him using AJAX?
So far my code is like this, not catching anything.
$.ajax({
type: "POST",
dataType: "json",
url: "/novo/engine/listarUsersGosteiPublicacaoFixa.php?id_publicacao="+$('#id_publicacao').val()+"",
success: function(data) {
for (var i=0;i<data.length;i++){
var imagem = data[i].imagem;
var nome = data[i].nome;
var nome_rede = data[i].nome_rede;
}
}
});
but if you have more than one piece of information? for example, two names, two images, two net_names, it has to be in the right loop?
– Furlan
One minute I’ll set it up for you
– Antony Alkmim
In this case ai data would not be an object, it would be an array
– Antony Alkmim