I have an API that returns the corresponding image of a status, but I'm having trouble picking only the 'pathname' field in my API response.
API Response:
({"code":1,"msg":"OK","details":[{"caminhofoto":"https:\/\/localhost\/sistema\/assets\/images\/status\/pendente.gif"}],"request":"{\"status\":\"pending\"}"})
Code that I'm using to get the field path:
$.ajax({
type:"GET",
url:"https://localhost/sistema/mobileapp/api/getImagemStatus?status=pending",
data: { get_param: 'caminhofoto' },
dataType: 'jsonp',
success: function(data) {
//Aqui tento pegar apenas o campo caminhofoto
var foto = data['caminhofoto'];
console.log("ENTROU AQUI "+foto)
},
});
On the console I get the log: Enter here undefined