I want to set an image src in my page with the image i receive from an ajax call response but i get a broken image icon when i set the image src with the reponse.
below is the ajax call
$.ajax({
url: '<%=request.getContextPath() %>/rest/tasks/file/'+temp_taskID+'?fileType=JPG' +
'&fileName='+imgNames[i],
headers: {
'apiKey':'1xxxx3-dde5-4eec-b3ee-2xxxx507xxe8',
'ID':ID
},
type: "GET"
})
.done (function(data, textStatus, jqXHR) {
$("#img_carousel").attr("src", "data:image/jpeg;base64," + data);
})
.fail (function(jqXHR, textStatus, errorThrown) {});
error