2013-11-04 81 views
1
<img src="image_not_found.jpg" onError="this.style.display = 'none';" alt="" /> 

上述代码在chrome中无法正常工作,删除后仍然显示未找到图像。但它在Firefox中起作用,我还应该添加什么来使其在Chrome中工作。煤矿是一个PHP的网站<img src="image_not_found.jpg" onError="this.style.display = 'none';" alt="" /> -not working in chrome

+0

你肯定在FF?无论如何FF默认隐藏未找到的图像,如果它们没有'alt'属性或它是空的。 – Teemu

+2

结果应该是什么,这是我在Chrome中得到的:http://jsfiddle.net/L8xvE/ – Rhyono

+0

@Teemu没有一个。 – Rhyono

回答

3

尝试小字:

onerror="this.style.display = 'none'" 
相关问题