Tell screen reader that page has changed in Backbone/Angular single-page app

前端 未结 3 1846
日久生厌
日久生厌 2020-12-02 21:14

Imagine you have a simple, single-page application - regardless of whether it was written using Backbone, Angular, Ember or anything else.

How can you tell a screen

3条回答
  •  北海茫月
    2020-12-02 22:03

    For angular the url changes, If someone REALLY needs to reread everything, (like me because of requirements), what did the trick for us was this:

    $(window).on('hashchange', function () {
        location.reload();
    });
    

    and we just added extra code to handle pages like "success" were no reloads are supposed to happen. this simulates the actual page loading, and screen readers will read it normally like a page change. kind of defeats the purpose of angular in a way, but this will help people like me who already have the application, and want a quick fix.

提交回复
热议问题