Although I have looked at all the various questions about this, I can not get my json to work, the code looks 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 anyone help me with this ??