Check this or more simple way: Get the public URL of the image
$("#your_image_id").attr('src','url return from ajax');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi developers, I am getting the image from ajax response with the header content-type image/jpeg, I would like to display it using the img tag. when I append the src of image to the response. it is not displaying the image.
the response having some weird text and symbols.
can any one guide me to solve this issue. thanks.
Please or to participate in this conversation.