Graceful Javascript degredation in Rails

Posted by Eric Stewart Mon, 21 Nov 2005 20:53:00 GMT

While I’m on the subject of web accessibility…

If you don’t read Encytemedia, head on over and start reading this series of articles on degradable Javascript. Justin is talking about this technique in general using his new javascript library along with Rails.

This looks to be a promising technique and I can’t wait to try it out. A big part of accessibility for sites that don’t want to skimp on the javascript goodness is making sure that the site degrades nicely and still functions when viewed by a browser (for example, a screen reader) that intentionally doesn’t support all that craziness.

And in addition those crazy people that turn off Javascript for the fun of it will still be supported too.

Posted in , ,  | Tags , , ,  | no comments

The New Web Platform and Leaving People Behind

Posted by Eric Stewart Sun, 23 Oct 2005 04:12:00 GMT

Thanks to AJAX, Javascript has had quite the revival recently. Web developers are suddenly re-engergized as their monotonous development strategies due to the limitations of browsers and their varied implementations are giving way to a new way of doing things.

I’ve been playing with these new techniques myself, trying to understand how it can and should be used and more importantly when it should be used.

Ajax isn’t really new. Well, the term is fairly new, and the techniques have been possible for a while, though obscure.

Javascript certainly isn’t new. But it’s capabilities across browsers are probably a little more standardized than they once were. We’re now seeing javascript libraries and components that were possible before, but nobody was really going there.

I read a thought provoking post on The Man In Blue that makes a good point regarding the web client as an application platform.

I think we are now at a crossroads. JavaScript is now developed enough to offer cross-browser, cross-platform solutions from the same codebase, and this has made it viable to develop large scale applications using it. Given that there is a difference between webpages and applications, and that they have different goals and requirements, it is meaningless to point out that a JavaScript application fails when you disable JavaScript. I could equally point out that Firefox fails when I remove my operating system.

Certainly there is a difference between what Google Maps or the latest Ajaxian RSS reader or email client are and the traditional informational web page. In the latter Javascript has typically been meant to add a little flash and enhanced usability yet was still relatively easy to degrade when Javascript was turned off in the browser. We’re in new territory now.

The New Web Application Platform

What has really changed? Well, the traditional web application is a server application. That’s where most of the code was executed, even to control what the user sees in their browser. Sure, some Javascript might be used in the same way as those old informational web pages: to enhance usability or give the user a little flash. But the server still knew what it had sent to the browser, and pretty much what the user was looking at.

The shift to the new type of web application is important. Now developers are trying to put as much of the work as possible in the hands of the browser. Rendering of the what the user sees as well as fetching data from whatever sources will be done more on the browser’s terms. For those familiar with good ol’ MVC software architecture we’re talking about just shifting where some of the view/controller logic lies and reducing the workload of the server while giving the user a more interactive experience.

Accessibility and Leaving People Behind

The Man in Blue posed the question:

“So, why can’t we require people to have JavaScript in order to run an application? You’re not targeting everyone, you’re targeting your market.”

We certainly can require Javascript for this application platform. It is being done! Just take your favorite new Javascript or Ajax web application that is impressing the masses and try it with Javascript disabled. It’s not going to work.

I’ll agree with The Man here that you must target your market. Where we might possibly disagree is that even with traditional web applications and even pages, people have restrictured their market unecessarily. That’s a whole other discussion on how to understand building a flashy, interactive site that can still be accessible.

You can certainly push this new Web Application Platform to its limits, using the latest Javascript and Ajax wizardry. But keep in mind that while accessibility APIs, toolkits, and techniques for native applications and traditional web pages have made great strides it providing greater accessibility you’ll be leaping ahead again and leaving them behind.

I’ll put it another way: when considering who your target market is, shouldn’t you have a damn good reason for leaving people out that want to user your application? When asking yourself how much and how soon about adopting these new techniques don’t just consider whether you can, but also whether you should.

Now I’ll try to quit being a hypocrite and try to go fix my own site’s accessiblity problems so more people can use it.

Posted in ,  | Tags , , ,  | 3 comments