当在src位置找不到图像时,想要隐藏图像吗?-wanttohideimagewhenimageisnotfoundatthesrclocation?
作者:大道废_796 | 来源:互联网 | 2023-06-03 10:25
jQuery(img).bind(error,function(){alert(hi);jQuery(this).hide();
jQuery('img').bind('error',function(){
alert('hi');
jQuery(this).hide();
});
I have written this code but non available images are not hiding and still showing cross sign. Can anybody point out what can be wrong. I am writing this under document.ready and i have tried it under window.onload as well.
我已经编写了这段代码,但是没有可用的图像没有隐藏,仍然显示交叉符号。谁能指出哪里出了问题吗?我是在文件下面写的。准备好了,我在窗下试过了。onload。
7 个解决方案