0
I have an API that returns the corresponding image of a status, however I’m having trouble getting only the field 'camiofoto' in my API answer.
Response from the API:
({"code":1,"msg":"OK","details":[{"caminhofoto":"https:\/\/localhost\/sistema\/assets\/images\/status\/pendente.gif"}],"request":"{\"status\":\"pending\"}"})
Code I’m using to take the field truck:
$.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)
},
});
In the console I get the log: Came in here Undefined
Solved, thank you very much.
– Matheus Arruda