Is there a way to display a default image instead of a broken image without changing the URL?
I have created a template editor where users can input dynamic URLs for images. Initially, the image appears broken, but when the user sends it, the correct image is retrieved and displayed.
When the image source is changed to a dynamic URL, a broken image is shown. I want to keep the source intact but display a good background image instead of the default broken image.
For example:
<img src="dynamic.src"></img>
If I write JavaScript to change the source on error to a static image, it would overwrite the link provided by the user as "dynamic.src" in this case.
Any suggestions would be greatly appreciated.