Unintentionally Blank

Phil Nash on the Internet, Web Standards and Accessibility

Web Accessibility -- Javascript

Oct 18, 2007

by Phil Nash

Continuing in my series of posts on different things to think about when considering web accessibility this week I want to look at JavaScript.

I actually had some inspiration in this post from my girlfriend. I accidentally left JavaScript disabled one night after doing some testing on a site and came home the next day to be told there was "something wrong with the internet." I quickly realised what had happened and rectified the situation, but the sites that she thought had broken may surprise you. Three major ones caught my attention and there's a fourth I'd like to mention as well.

Sites That Rely On JavaScript

Windows Live Mail (formerly Hotmail)

First up is a huge disappointment. Hotmail, and, following it now, Windows Live Mail, is used by millions around the world. Try to access your mail without JavaScript enabled and you get nothing. Well, not nothing, you get a message telling you JavaScript is required. No help though, no helpful links and certainly no way of logging on without JavaScript enabled. Taking a closer look at the login page and it turns out that the whole page is just one JavaScript file that is run as the page is loaded.

JavaScript can help to enhance programs like webmail, all the big providers use JavaScript and AJAX to speed up the service and make it seem more like a desktop client like Outlook, but where's the fall back for Windows Live Mail? GMail gives you the option for an HTML only version that works perfectly well without JavaScript. Live users can't even get to the Live help section when JavaScript is disabled to find out what's wrong!

Nationwide Building Society

Visiting the Nationwide to do some online banking without JavaScript enabled seems OK to start with, but click on "Sign On" and you are presented with a blank page. No sign of what has gone wrong. It turns out that the blank page you are met with is merely performing a JavaScript redirect to another page, when the redirect doesn't fire, nothing else happens. This sort of thing could easily be done by the server rather than the browser, but that choice leaves users locked out of their bank.

Facebook

Popular social network Facebook has a popular feature known as the Wall, where you can post messages to your friends. Visiting Facebook and navigating around without JavaScript enabled is fine, but posting to someone's Wall falls apart, you just can't. These days, Wall posts are handled by AJAX and your post appears on your friend's Wall without the page refreshing. Previously, I remember posts being processed normally, by submitting the form and the page refreshing, something that can certainly be accomplished without JavaScript.

I am particularly disappointed with Facebook for that fact. In a recent post I recommended that the first rule of AJAX was not to use it. In fact you should always be able to complete essential tasks without JavaScript or AJAX first, then you can enhance the site employing those technologies for those who have access to them. Facebook had non JavaScript functionality in place, but instead of enhancing it, they replaced it with JavaScript dependent functionality.

MySpace

I actually discovered MySpace's problem while listening to one of the open mic slots at Future Of Web Apps. AbilityNet were talking about accessibility and web 2.0 sites when MySpace came up. They showed an interview with a blind user who spoke about their experience with using a screenreader and MySpace. If you use MySpace you will know that you can edit who your top friends, those that appear on your profile, are. The only way to do this is by dragging and dropping (powered by JavaScript) them into place. This is not a problem for those with JavaScript enabled and a mouse, but blind users are unable to use a mouse or even access the friends to move them in any way. Screen reading software can manage some JavaScript too, but visual positions on a screen are no use to a blind user and the lack of any fall back through normal HTML, say by entering a number for the position you want your friend to appear on your list, leaves users with Tom as their top friend.

Why Does This Matter?

Not all internet users have JavaScript enabled. I'm not just referring to girlfriends of developers who occasionally get stuck without a clue what is going on either. Some people and companies (therefore all users online at work in those companie, though they shouldn't be using Facebook anyway!) prefer to surf without JavaScript enabled for security reasons, some people don't have JavaScript enabled browsers and others can't use certain methods that JavaScript makes available (drag and drop when you can't see or can't use a mouse, for example).

The w3schools site collects browser statistics from their logs, including JavaScript. While they aren't the most accurate (the site is mainly used by people learning about web technologies), they do show that a small percentage of users do not have JavaScript enabled, 6% at the last count in January 2007.

The important thing is that your website functionality doesn't need JavaScript. Everything important should and can be done by the server first, you can then enhance the experience with JavaScript for those who have it available, instead of locking out those who don't.

Unintentionally Blank is Phil Nash's thoughts on web development from 2006-2008. Any code or opinions may be out of date.