Using Javascript, I\'m making an AJAX call to a WCF service, and it is returning a byte array. How can I convert that to an image and display it on the web page?
Late to the party but if your response looks like
[137,80,78,71,13,10,26,10,0,...]
you can use this:
var imgsrc = "data:image/png;base64," + btoa(String.fromCharCode.apply(null, new Uint8Array([137,80,78,71,13,10,26,10,0,...]))); document.getElementById('image').src = imgsrc;