如果没有找到源图像,我需要在表格的单元格中显示一个替代图像。 目前下面的代码用于这样做。
cell.innerHTML="<img height=40 width=40 src='<%=request.getContextPath()%>/writeImage.htm' onError='ImgErrorVideo(this);'>"
function ImgErrorVideo(source){
source.src = "video.png";
source.onerror = "";
return true;
}
现在的问题是,上面提到的解决方案只能在 Internet Explorer 中使用,而不能在 mozilla 中使用。
请告诉我一些在所有浏览器中都可以工作的解决方案。