易于访问、符合 508 标准的 Ajax 分页

发布于 2024-10-03 09:22:59 字数 1307 浏览 8 评论 0原文

我正在尝试使支持 Ajax 的表分页符合 508 标准(可使用 JAWS 版本 9 进行访问)。我有一个表头单元格,其中包含一个链接,该链接执行 jQuery ajax 请求 onclick 并带有回调来更新表。我已经成功地在链接正文中使用“间隔”图像,并使用替代文本向 JAWS 用户传达排序信息(注意:JAWS 默认情况下不读取工具提示),但视力正常的用户看不到。但是,当 JAWS 用户导航到链接(使用向上和向下箭头键)并按空格键来初始化链接 onclick 事件时,我遇到两个问题:

  1. 没有向 JAWS 用户传达表明表内容已更新的信息,
  2. 当内容更新时,JAWS 用户刚刚执行的链接会被重新读取,但它会重新读取表更新之前的替代文本,用户必须前进到下一个字段,然后返回到链接让 JAWS 读取更新后的替代文本。

任何具有实现无障碍 Ajax 分页经验的人都将不胜感激!我的表头单元格代码如下:

<th title="Sorted column, toggle sort from Ascending to Descending" controller="xxxManagement" id="xxxName" scope="col" class="sortable sorted asc" >
    <a href="/app/xxxManagement/listXXX?max=20&sort=name&order=desc" onclick="toggleLoadingAnimation();jQuery.ajax({type:'POST',data:{'controller': 'xxxManagement','max': '20','sort': 'name','order': 'desc'}, url:'/app/xxxManagement/listXXX',success:function(data,textStatus){jQuery('#xxxList').html(data);},error:function(XMLHttpRequest,textStatus,errorThrown){},complete:function(XMLHttpRequest,textStatus){toggleLoadingAnimation()}});return false;" title="Sorted column, toggle sort from Ascending to Descending">
        Name
        <img src='/app/images/pixel.gif' alt='Sorted column, toggle sort from Ascending to Descending' />
    </a>
</th>

I am trying to make my Ajax-enabled table pagination 508-compliant (accessible using JAWS version 9). I have a table header cell with a link which executes a jQuery ajax request onclick with a callback to update the table. I've had success using a "spacer" image inside the link body with alt text conveying sort information to JAWS users (note: tooltips are not read by default by JAWS) but which is not seen by sighted users. However, when a JAWS user navigates to the link (using the up and down arrow keys) and presses SPACE to initial the link onclick event, I have two problems:

  1. no information is conveyed to the JAWS user indicating that the table content has been updated,
  2. when the content is updated, the link the JAWS user just executed gets re-read, but it re-reads the alt text from before the table was updated, the user has to advance to the next field and then return back to the link for JAWS to read the updated alt text.

Tips from anyone with experience implementing accessible Ajax pagination would be much appreciated! My table header cell code follows:

<th title="Sorted column, toggle sort from Ascending to Descending" controller="xxxManagement" id="xxxName" scope="col" class="sortable sorted asc" >
    <a href="/app/xxxManagement/listXXX?max=20&sort=name&order=desc" onclick="toggleLoadingAnimation();jQuery.ajax({type:'POST',data:{'controller': 'xxxManagement','max': '20','sort': 'name','order': 'desc'}, url:'/app/xxxManagement/listXXX',success:function(data,textStatus){jQuery('#xxxList').html(data);},error:function(XMLHttpRequest,textStatus,errorThrown){},complete:function(XMLHttpRequest,textStatus){toggleLoadingAnimation()}});return false;" title="Sorted column, toggle sort from Ascending to Descending">
        Name
        <img src='/app/images/pixel.gif' alt='Sorted column, toggle sort from Ascending to Descending' />
    </a>
</th>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

树深时见影 2024-10-10 09:22:59

不幸的是,我认为简短的答案是你不走运。我经常遇到 Jaws 告诉我内容何时更新的问题,有时需要刷新屏幕才能更新 Jaws 的虚拟缓冲区。 Jaws 9 也是一个有点过时的版本,但如果您正在为已对该版本进行标准化的部门编写内部应用程序,您可能必须处理它。我会建议两件事。选项一是下载上个月发布的jaws 12 版本。如果这解决了您的问题,也许您可​​以证明升级是合理的?选项二是查看 WAI-ARIA 这应该让您将表格标记为实时区域并自动宣布更新。我对此没有任何经验,但它可能有效。我不知道 Jaws 9 对 WAI-ARIA 的支持有多好,但 Jaws 10 似乎做得相当不错。请参阅此博客条目比较 WAI-ARIA 的屏幕阅读器支持。您始终可以使用 Jaws 9 进行列出的测试,以了解 WAI-ARIA 支持是什么样的。

Unfortunately I think the short answer is you’re out of luck. I frequently have issues with Jaws telling me when content is updated, and sometimes it takes a screen refresh to update the virtual buffer of Jaws. Jaws 9 is also a somewhat out of date version but you may have to deal with it if you’re writing internal apps for a department that has standardized on that version. I would suggest two things. Option one is to download jaws version 12 which has been released in the last month. If that fixes your problem maybe you could justify an upgrade? Option two is to look into WAI-ARIA This should let you mark your tables as live regions and have updates automatically announced. I don't have any experience with this but it may work. I don't know how well Jaws 9 supports WAI-ARIA but jaws 10 appears to do a fairly good job. see this blog entry for a comparison of screen reader support for WAI-ARIA. You could always do the listed tests with Jaws 9 to get an idea of what WAI-ARIA support is like.

拿命拼未来 2024-10-10 09:22:59

这可能无法解决您的具体问题,但如果您使用渐进增强来实现,我认为它会解决问题。换句话说,让页面导航通过传统(非 ajax)链接进行工作,然后在这些链接上连接 ajax 单击事件。

如果使用非 JS 浏览器或屏幕阅读器,它只会导航到下一页。如果使用常规的现代浏览器,它将提供 ajax 体验。可访问性是内置的,不会失去 ajax 体验。

This might not address your specific question, but if you implement with progressive enhancement, I think it would solve the problem. In other words, have your page navigation work via traditional (non-ajax) links, then wire up ajax click events on those links.

If using a non-JS browser or screen reader, it'll simply navigate to the next page. If using a regular modern browser, it'll give the ajax experience. Accessibility is built in w/o losing the ajax experience.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文