更新时间:2022-10-15 23:34:26
您可以使用onerror处理程序。在内联表格中,它看起来像这样:
< img src =someimage.jpgonerror =this.style 。显示=无; />
I have my image inside an if statement:
if (item.image)
historyHtml += '<a href=' + item.image + ' class="image" target="_blank"><img src="' + item.image +'" width="111px"/></a>';
You can use the onerror handler. In the inline form, it looks like this:
<img src="someimage.jpg" onerror="this.style.display='none';" />