JavaScript, rails, and the W3C

Hey all!

Has there been any discussion about transitioning the Rails and/or Ajax
helpers that generate HTML / JavaScript code so that they avoid using
onClick events? I’m attempting to create valid XHTML 1.0 Strict code to
improve cross-browser interoperability, but I never get valid results
when using a lot of the included helpers, and a lot of examples I see on
this list still resort to ‘onClick’ events.

A good example would be using JavaScript code that adds the onClick
events on the client side… Your XHTML code remains valid, but this
link

Click here for more information

Becomes

Click here for more information

Again, the reason for doing this is that your application can

  1. still be used by devices that don’t completely support Javascript
  2. you can provide valid documents (very helpful when creating
    accessible applications)
  3. You can separate your content from your events
  4. You can reduce code (see unobtrusive table sorting)
  5. You can still use JavaScript and Ajax!!!
  6. It promotes web standards!

It seems a shame to me that Rails is so far ahead of the curve on so
many other things, and yet it still tends to do things in a way that’s
not standards-compliant. That’s why I was wondering if this has been
given some consideration by the core team. As a developer (and a user)
of sites that must adhere to various accessibility and standards
regulations, this is a concern to me.

Thanks for your time.

Brian H.
Web D.
Learning & Technology Services
Schofield 3-B
University of Wisconsin-Eau Claire
715 836 3585
[email protected]

hi,

A good example would be using JavaScript code that adds the onClick
events on the client sideâ?¦. Your XHTML code remains valid, but this
link

Click here for more information

Becomes

Click here for more information

i fear i don’t get your point. how would that help? you’d have to a) add
the code for adding the onclick() event somewhere (thus not making the
code any shorter) and if a client does not fully support javascript, it
will not matter very much where he does not understand the js…
maybe i just seriously misunderstood you?

  1. you can provide valid documents (very helpful when creating
    accessible applications)

how is that helpful? i’d say the most important thing is that the code
you generate is understood by the application you want to support
(pragmatic view of things, i know) and if i think about the fact that
the most-widely-used browser - alas - still cannot fully deal with
css2.0, i don’t see how standard-compliance on the web-application side
can further accessibility :slight_smile:

  1. You can separate your content from your events

good point, but that depends on the developer, not on the
standard-compliance of the framework, i’d suggest.

given some consideration by the core team. As a developer (and a
user) of sites that must adhere to various accessibility and standards
regulations, this is a concern to me.

this is a very valid and true point. and considering that you have to
follow certain standards and regulations, most of the things you wrote
above now appear in a different light (to me, at least). i’ll post that
mail nevertheless, maybe thus triggering a fruitful discussion :smiley:

maybe you could point out to me what i did not understand (see above).

best regards,

t