0
Although I have looked at all the various questions about it, I cannot make my json work, the code is like this:
$.ajax({
url: '<?= base_url('login/Pesquisar'); ?>',
type: 'POST',
data: $("#formulario_pesquisa").serialize(),
dataType: 'json',
success: function(data){
alert(JSON.stringify(data))
alert(Object.keys(data));
alert(data.email);
}
});
The results are:
alert(JSON.stringify(data)) >>> {"cnpj ":"68.207.717/0001-42","email ":"[email protected]","Logado":true)
alert(Object.keys(data)); >> cnpj ,email ,Logado
alert(data.email); >> undefined
Can someone help me with that??
the problem should be exactly what Gabriel said. Only one to include also if Voce has no way to change the server can get the value like this
data['email ']
note that you have space after email– Neuber Oliveira
True, it could work this way too, but I had how to change yes, it was a slip even rsrs. Thank you very much/
– Gabriel Santos