I have this method, I have to log in into the "Storage app" and display the img in a html img but don't know how to parse 2nd success function.
PD: I checked that I reach that success method with console logs.
setTimeout(function() {
$.ajax({
contentType: 'application/json',
data: JSON.stringify({
"username": "username",
"password": "password"
}),
dataType: "json",
processData: false,
type: 'POST',
url: pathStorage + "/api/login",
async: false,
complete: function(data) {
var response = $.parseJSON(data.responseText);
$.ajax({
type: 'GET',
url: pathStorage + "/web-app/files/" + id + "_imagen.jpg",
headers: {
"Authorization": response.token_type + " " + response.access_token
},
success: function(data) {
//this dont works
$('#idImg').prop('src', 'data:image/jpg;base64,' + data)
}
})
}
})
}, 1000)