Javascript <;img src=”等;未找到.jpg";onError=";this.style.display=';无'&引用;alt="&引用/&燃气轮机-不在chrome中工作

Javascript <;img src=”等;未找到.jpg";onError=";this.style.display=';无'&引用;alt="&引用/&燃气轮机-不在chrome中工作,javascript,html,Javascript,Html,上述代码在chrome中不起作用,删除后仍显示未找到图像。但是它在firefox中工作,我还应该添加什么才能使它在chrome中工作呢。我的是一个php网站试试小写字母: <img src="image_not_found.jpg" onError="this.style.display = 'none';" alt="" /> 试试小写字母: <img src="image_not_found.jpg" onError="this.style.display = 'none

上述代码在chrome中不起作用,删除后仍显示未找到图像。但是它在firefox中工作,我还应该添加什么才能使它在chrome中工作呢。我的是一个php网站

试试小写字母:

<img src="image_not_found.jpg" onError="this.style.display = 'none';" alt="" />
试试小写字母:

<img src="image_not_found.jpg" onError="this.style.display = 'none';" alt="" />

你确定它在FF中有效吗?FF在默认情况下隐藏未找到的图像,如果它们没有
alt
属性或为空。结果应该是空的,这就是我在Chrome中得到的结果:@Teemu没有一个。“onError=“this.style.display='none';“alt=”“/>仍然显示未找到的图像???您将
onerror
s附加到
a
元素,而不是页面上的
img
元素…您确定它在FF中有效吗?FF在默认情况下隐藏未找到的图像,如果它们没有
alt
属性或为空。结果应该是空的,这就是我在Chrome中得到的结果:@Teemu没有一个。“onError=“this.style.display='none';“alt=”“/>仍然显示未找到的图像???您将
onerror
s附加到
a
元素,而不是页面上的
img
元素。。。