# RE: JavaScript, rails, and the W3C

**URL:** <https://www.ruby-forum.com/t/re-javascript-rails-and-the-w3c/56154>\
**Category:** Rails\
**Created:** [December 1, 2005, 8:17pm UTC](https://www.ruby-forum.com/t/re-javascript-rails-and-the-w3c/56154 "2005-12-01T20:17:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HOGANBP](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@HOGANBP](https://www.ruby-forum.com/u/HOGANBP)\
**Post date:** [December 1, 2005, 8:17pm UTC](https://www.ruby-forum.com/t/re-javascript-rails-and-the-w3c/56154/1 "2005-12-01T20:17:15Z")

</div>

Thanks for the reply.

“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?”

Well let’s say for example that you wanted to have hyperlinks that open  
popup windows. Since “target=”\_blank"" is deprecated, you’d have to do  
a javascript popup.

But, let’s say you’ve got a blind user using a screen reader. Many  
screen readers just don’t understand JS, and popups can be confusing.  
So you might just have the link point to the page by default, and use  
client-side js to “apply” the popup by changing the href from ‘foo.htm’  
to ‘javascript:popup(‘foo.htm’)’.

The same can be true for “show/hide” elements on a page… Show them  
all when no javascript is enabled, and use client-side js to create the  
“show / hide all” link on the page as well as hide elements on the page  
load.

I also might find that instead of using the same "onclick=“foo{params,  
parsms, params)”, I have a common file that I could reference.

Just like prototype… Why do ‘getElementByID(‘foo’)’ when you can do  
$(‘foo’);

1. “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 :-)”

Accessible means accessible… By anyone on any platform. Those with low  
vision might require screen readers… Those with old browsers still  
want to buy your product. Those with fine motor skill impairments have  
difficulties using the mouse, so you’re careful how you make things  
appear and disappear based on events… Etc.

A great start to achieving this is to ensure that your XHTML and CSS is  
valid. If you’ve got “onClick” all over the place, you’re not going to  
have valid docs… And you’re going to skip validating because you  
_know_ it won’t be valid.

I would say that your application (especially if you’re attempting to  
reach the largest audience possible) is not useful unless it can be used  
without css or javascript enabled. It’s not going to be a _fun_  
experience, but it doesn’t have to frustrate the user who  
happens to be using a 320x240 smartphone to do some quick work.

Finally, as a person who supports (and occasionally has to use)  
assistive technologies, I want to do what I can to make the Web a little  
more friendly and accessible.

1. content separation: “good point, but that depends on the developer,  
not on the standard-compliance of the framework, i’d suggest.”

I agree, but if the majority of the community is using the built-in  
helpers, the framework is negatively contributing to  
standards-compliance… Just like developers who use FrontPage or some  
of the .Net widgets out there and thus only support Internet Explorer on  
Windows.

I recommend the following reading for some more examples and strategies:

> **[Let Them Eat Cake](https://alistapart.com/article/eatcake/)**
>
> A growing debate pits accessibility against usability. From our point of view, it’s like pitting peanut butter against jelly. This article helps you create a page that is both usable and acce…

[http://www.onlinetools.org/articles/unobtrusivejavascript/](http://www.onlinetools.org/articles/unobtrusivejavascript/)

[http://www.kryogenix.org/code/browser/](http://www.kryogenix.org/code/browser/)

Thank you! I really appreciate your interest in this conversation. If I  
can be involved any more, please let me know. I hope I’ve helped make a  
few things more clear.

Regards,  
-Brian

---

<div class="post-metadata">

**Author:** ![HOGANBP](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@HOGANBP](https://www.ruby-forum.com/u/HOGANBP)\
**Post date:** [December 2, 2005, 11:38am UTC](https://www.ruby-forum.com/t/re-javascript-rails-and-the-w3c/56154/2 "2005-12-02T11:38:48Z")

</div>

On Thursday 01 December 2005 20:15, Hogan, Brian P. wrote:

> A great start to achieving this is to ensure that your XHTML and CSS  
> is valid. If you’ve got “onClick” all over the place, you’re not  
> going to have valid docs… And you’re going to skip validating  
> because you _know_ it won’t be valid.

Are you suggesting, that onclick(!) attributes cause documents to be  
non-conforming to the XHTML 1.0 recommendation? I can assure you that  
this is not the case.

Michael

–  
Michael S. I am the sum total of the parts  
[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) I control directly.  
[Michael Schürig | Sentenced to making sense](http://www.schuerig.de/michael/) --Daniel C. Dennett, Elbow Room

---

<div class="post-metadata">

**Author:** ![HOGANBP](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@HOGANBP](https://www.ruby-forum.com/u/HOGANBP)\
**Post date:** [December 2, 2005, 11:47am UTC](https://www.ruby-forum.com/t/re-javascript-rails-and-the-w3c/56154/3 "2005-12-02T11:47:01Z")

</div>

Hi all,

2005/12/2, Michael S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Are you suggesting, that onclick(!) attributes cause documents to be  
> non-conforming to the XHTML 1.0 recommendation? I can assure you that  
> this is not the case.

## He said “onClick”, not “onclick” 🙂

Juan G. Hurtado  
[removed\_email\_address@domain.invalid]  
[[http://armonia.spiral-static.org/](http://armonia.spiral-static.org/) ]

---

<div class="post-metadata">

**Author:** ![HOGANBP](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@HOGANBP](https://www.ruby-forum.com/u/HOGANBP)\
**Post date:** [December 3, 2005, 11:27pm UTC](https://www.ruby-forum.com/t/re-javascript-rails-and-the-w3c/56154/4 "2005-12-03T23:27:47Z")

</div>

Some other good sites that advocate unobtrusive javascript:

[http://www.bobbyvandersluis.com/](http://www.bobbyvandersluis.com/)

[http://www.quirksmode.org/](http://www.quirksmode.org/)

Thanks  
graeme
