如何防止屏幕阅读器从IE中的img标签读取src属性 [英] How to prevent screen reader from reading src attribute from img tag in IE

查看:208
本文介绍了如何防止屏幕阅读器从IE中的img标签读取src属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IE9或以下版本的屏幕阅读器面临着一个非常直接的问题。当屏幕阅读器查看具有 src 属性的图片标签时,它会读取 src 的内容。即使存在 alt 属性,它也会读取 src 中的内容。



完全清楚:只发生在IE 9或以下



这是我的一个非常简单的例子代码:

 < img src =http://placehold.it/100x100alt =某图片/> ; 

我不明白为什么会发生这种情况。任何关于如何解决这个问题的帮助,或者没有,没有解决方案 plus proof 的事实,我们将非常感激。

解决方案

我认为你遇到了一个新的NVDA版本和IE旧版本的bug。 Firefox(近期)和NVDA,或者是IE9时代的JAW版本(我认为它会这样做),我相信你会得到alt文本。 b

在证明方面,官方文件是WAI ARIA角色文本替代计算,然后引用HTML4如何指定替代文字



基本上,替代文字是应该使用的,您在组合中遇到错误屏幕阅读器和浏览器很难被使用她的。 (NVDA最适合Firefox,你可以在IE9中使用Jaws。)


I am facing a very straight forward problem with screen readers in IE9 or below. When the screen reader looks at an image tag, which has the src attribute, it reads the content of the src. Even if the alt attribute is present, it reads the contents inside the src.

To be perfectly clear: this only happens in IE 9 or below

Here is a very simple example of my code:

<img src="http://placehold.it/100x100" alt="some image"/>

I don't understand why this is happening. Any help on how to get around this issue or the fact that no, there is not solution plus proof, would be very appreciated.

解决方案

I think you're hitting a bug with a new verison of NVDA, and an old version of IE.

Try the code with Firefox (recent) and NVDA, or a version of JAWs from the IE9 era (version 12 I think would do), and I'm fairly sure you'll get the alt text.

In terms of proof, the official document for this is the WAI ARIA roles "Text alternative computation", which then refers to the HTML4 "How to specify alternative text".

Basically, the alt text is what should be used, you're hitting a bug in a combination of screenreader and browsers that are very unlikely to be used together. (NVDA works best with Firefox, you would use Jaws with IE9.)

这篇关于如何防止屏幕阅读器从IE中的img标签读取src属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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