Accessible AJAX
May 8th, 2008. Published under General. No Comments.
Is use of AJAX classes as immature? That is the opinion of Brothercake Well firstly i immediately think… No way! I have spent a good few years doing plain JavaScript and in the last year ventured into AJAX with my DorsetExplorer project (which I might talk about in another post).
So what could be classed as immature? Well this got me thinking about a category that jumped to mind, which is accessibility.
I will jump to the assumption that a screen reader like Opera Voice just reads the compiled HTML and picks out the text from the page. So straight away I can see the problem with this. As AJAX brings data to the browser after the initial “composition” the screen reader will not pickup anthing that is done after the HTML has loaded. So even if the AJAX prints text from the server it will not be picked up by the screen reader.
Obviously the code returned should be compliant to which ever web standard (DTD) they are using and also keeping accessibility standards (A, AA and AAA) in mind.
So there is one solution. Make a screen reader read the “generated source”. So it will grab the HTML from the site everytime it wants to read something. Wouldn’t that solve everything? If you are like me and use the Firefox web dev toolbar you will know that if you use JavaScript to print code after the onload event for the page has fired, the “view source” and “view generated source” will be different, the latter displaying the correct HTML.
Anyway thought that might be a nice talking point! Any opinions?
Ollie