DEV Community

Discussion on: HTML fallback images on error

Collapse
 
amabe_dev profile image
amabe_dev • Edited

Note: It's not a great practice to rely on external images. You ideally want to have the fallback image locally in the file system, so it's a reliable fallback.

Definitely true. Otherwise we will enter an infinite loop because the onerror will be called again and again.

Also we probably want to display an better looking broken image placeholder for accessibility reasons. The fallback should show that this is not the intended image at first sight.

Collapse
 
dailydevtips1 profile image
Chris Bongers

Exactly, trust me I tried it and it can crash Chrome 😂

Ah good second point, thanks for that 💖