Fernando Skackauskas wrote:I am using AJAX because the image is recorded in a database Mysql. A Blob filed.
That makes no sense. That's like saying "I'm using a
coffee cup to cut my food". Ajax is not suitable for image data.
Use the right tool for the job.
So, I am retrieving the image from MySQL - a Blob field. Then, when I receive the image in my website, I do not know how show the image using JavaScript.
I already told you -- you change the
src attribute.
The code you are using to retrieve the image data from the DB needs to be changed to return it as the response of a servlet (or whatever you are using), and with the correct content headers set. Then use the URL of that servlet (or whatever you are using) as the
src of the image. (You may need to add a random request parameter to make the browser recognize that the
src URL has changed if there are no other differences.)