NYCPHP Meetup

NYPHP.org

[nycphp-talk] Thoughts on using JavaScript with no progressive fall-back

csnyder chsnyder at gmail.com
Mon Feb 26 18:28:17 EST 2007


On 2/26/07, Cliff Hirsch <cliff at pinestream.com> wrote:
>
>  I'm seeing more and more applications that simply do not work if JavaScript
> is turned off. In fact, I'm looking at purchasing a slick shopping cart that
> seems great, but I think the lack of progressive fallback is a show stopper.

I'm a big fan of the "unobtrusive" approach, where you build
interfaces in Plain Old HTML + CSS and then use wicked DOM mojo to
convert them into rich applications on the client. If Javascript isn't
available, everything still works but with a lot more clicking.

As an example, to add an inline audio player on a page, I'll send this
to the browser:

<a href="/path/to/some.mp3" class="audioplayer">Click here to play the audio</a>

A window.onload event calls a javascript method that gets all <a>
elements with class="audioplayer", and replaces them with a
flash-based audio player, using the href attribute as the source of
the audio.

Without javascript and flash, you get a dumb link. With those evil
twins, you get a rich multimedia experience. As a bonus, the dumb link
is (in theory) accessible to screen readers, which seems especially
important for this particular example.

-- 
Chris Snyder
http://chxo.com/



More information about the talk mailing list