草庐IT

imageRow

全部标签

javascript - 如果图像损坏,请移除图像及其容器

我只是想删除图像及其标题,以防图像无法加载或使用html或JavaScript损坏。最好和最简单的方法是什么?'onerror='imgError(this)'/>//iwanttoremovethistitleaswellfunctionimgError(image){image.onerror="";image.src="http://localhost/domain/images/error.jpg";document.getElementById('tit').style.display='none';returntrue;}上面的代码将从数据库中获取5张图像,使用javasc