Is there a way to show alternate image if source image is not found? I know to accomplish this is by doing something like below:
<img src="imagenotfound.gif" alt="Image not found" onError="this.src='imagefound.gif';" />
But how about if you are doing something like this, how can you catch if there is an error or if the image is not found?
<div style="background:url('myimage.gif')"></div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…