WebAIM - Web Accessibility In Mind

E-mail List Archives

Using "alert" or "confirm" javascript functions in place of modal dialog box, is that a bad practice?

for

From: Birkir R. Gunnarsson
Date: Mar 19, 2012 9:45AM


Hi everyone

At Access U and CSUN we had some discussions regarding modal dialog
boxes, and how screen readers can easily get around them, thus
potentially confusing the end users.
I recommended using the Javascript alert function to get around this
for a page I consulted on recently, and we have not gotten any
complaints about it, at least not yet.
Yesterday I was reading entries on the W3Fools website (page that was
set up to point out problems with W3Schools, no association with the
W3C).
Under the Javascript section it says that using alert() or confirm()
is bad practice and it should be avoided, though it gave no further
explanations.
Does anyone have any thoughts on this either way?
Cheers
-B