Use the onerror event of the image object to judge. If an error occurs, replace the src of the image object with the URL of the default image.
The following is the judgment through js
Use javascript to judge whether the specified image file exists:
For example, judge
this picture Whether the address exists.
If it does not exist, re-detect the image every few seconds. If the address is valid, it will prompt that the address is valid
The above returns true if the image exists
If the image exists, return GIF89aX
Because the picture does not exist, return that the picture does not exist!