Fail to show an URL image with html code

Fail to show an URL image with html code

QGin
Visitor
2 0 0

I have written a script to call the image URL but the image cannot be shown.


However, the image is not displaying correctly on the webpage. Instead, a broken image icon appears (? in a box). The image URL works when pasted directly into the browser but does not render properly in the tag on the webpage. When I right click the image, it allows me to open image in a new tab and the image can be shown in the new tab!!

 

Extract of the coding I tried: 

Screenshot 2025-03-05 at 5.42.11 PM.png

 

>> what's wrong with it? How can I fix it please? thanks!

Reply 1 (1)

Shadab_dev
Shopify Partner
1255 64 132

Have you tried checking if data.imageUrl is a valid url?

Buy me Coffee, if you feel i was helpful. Email Me here or WhatsApp me with this link for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.