I have a image in response from the server i am trying to add it as a image tag but i am having problems here is my code:
$.ajax({
type: "get",
url: "SOME_IMAGE_URL",
contentType: "image/png",
success: function (data) {
var img = new Image();
var url = window.URL || window.webkitURL;
img.src = url.createObjectURL(data);
document.getElementById("createThingicon").appendChild(img);
},
});
When Responded image is appended to HTML its not showing rather its a broken image.Is there something wrong in my code? I hard coded the URL so that you can check the response