为什么在图像无法加载时不会显示提供的替代文字? [英] Why would the supplied alt text not display when an image fails to load?

查看:119
本文介绍了为什么在图像无法加载时不会显示提供的替代文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在此帖子中添加更新10:为什么我的img错误功能失败?,但我会超过最大帖子长度,因此必须开始一个新问题。

I attempted to add update 10 to this post: Why does my img error function fail?, but I would have surpassed the maximum post length, and so have to start a new question.

我明显的明显问题一直忘记的是,我正在为每个图像提供alt文本值,因此,无论何时未加载或因任何原因不显示,alt文本都应显示在图像的位置,对?它不是 - 永远。所以,既然没有发生这种情况,也没有任何答案可行,也许是因为某种原因我的网站没有意识到图像是坏的......这可能吗?

The "obvious" issue I've been forgetting this whole time is that I'm supplying an "alt" text value for each image and so, whenever they aren't loaded or don't display for any reason, the alt text should display in place of the image, right? And it's not - ever. So, since this is not happening, nor did any of the answers work, maybe for some reason my site doesn't realize when the images are "bad"... is that possible?

推荐答案

还有另一种可能的解释。

There is another likely explanation.

通常其他服务器会提供不同的图像而不是所需的图像您尝试将其图像加载到您自己的服务器上的网页上。这样在那里有一个图像,因此没有检测到错误。但是你仍然看不到你想看到的图像。

Often other servers will provide a different image rather than the desired image when you try to load their image onto your web page on your own server. This way there is an image there, so no error is detected. But you still don't see the image that you wanted to see.

这绝对可以解释为什么我建议的插件(以及其他人以后) )不行。插件无法分辨出图像应该是什么,因此它无法检测您想要查看的图像是否存在,或者只是检测到服务器提供的空白图像,而不是阻止您使用它们你网站上的图片。

This is definitely a possible explanation of why the plug-in that I suggested (and someone else later) would not work. The plug-in cannot tell what the image was supposed to have been, so it is unable to detect whether the image you wanted to see is there, or just a blank image provided by the server instead as a way of blocking you from using their images at your site.

你可以自己找出这个解释是否适用于任何神秘地似乎没有被检测为错误的图像但是没有出现。

You can find out for yourself whether this explanation is applicable for any of the images which mysteriously don't seem to be detected as having an "error" and yet do not show up.

只需右键单击图像并使用浏览器提供的选项来检查图像/检查其URL或其他属性。如果那里有图像但是没有图像显示,那么当您尝试交叉链接到图像并在您的网站中加载图像时,服务器会用空图像动态替换真实图像。

Simply right-click on the image and use the options your browser provides to inspect the image / examine its URL or other properties. If there is an image there but yet no image shows, then the server is replacing the real image dynamically with an empty image when you try to cross-link to it and load their image within your site.

这篇关于为什么在图像无法加载时不会显示提供的替代文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆