0
I am receiving a JSON and would like to set variables with such information. How do I do this?
$.ajax({
url: "/pessoa-gerenciar/consultar-codigo-postal",
type: "GET",
data: { codigoPostal: $('#PessoasEnderecosViewModel_' + rowIndice + '__CodigoPostal').val().replace("-", ""), paisId: $('#PessoasEnderecosViewModel_' + rowIndice + '__PaisId').val() },
traditional: true,
success: function (data) {
var dados = JSON.stringify(data);
var codigo = ?
var logradouro =
},
error: function () {
alert("Oops! Algo deu errado.");
}
});
do not need to stringfy, the data is already a json object, just a date.algumacoisa for example
data.cep
– Ricardo Pontual
Ah ok.. Only that the data returns as if it were a class. It has the name cep and inside the Fields... How I get their information?
– Master JR