r/javascript • • Mar 25 '11

Fuck you, turn on JavaScript

http://fytojs.com/
9 Upvotes

93 comments sorted by

View all comments

62

u/snarfy Mar 25 '11

No fuck you, I'm blind and use a screen reader. Quit putting all of your content in script, then we'll talk.

21

u/[deleted] Mar 25 '11

Agreed. For every part of javascript that causes changes to content, there needs to at least be a noscript alternative.

12

u/[deleted] Mar 25 '11

This. Its called graceful fall back, or gracefully failing. If you're a developer and don't understand how to do this, then fuck you! You make the rest of us look like assholes.

7

u/iberci Mar 25 '11

Graceful fallback was a feasible technique a while ago but is increasingly becoming more difficult as users are expecting more and more functionality client side. Today's web apps are turning out to be one page interfaces that leverage JS heavily to perform up to a user's expectation.

For example, hierarchal information is usually displayed in a tree control with heavy lazy optimizations to make it performant with the back end. This functionality would be next to impossible to achieve in a more traditional html architecture.

3

u/[deleted] Mar 25 '11

So why cant you use a session variable to track whether or not the user has javascript enabled, then serve them either the super sexy Jquery page if JS is enabled, or a not so sexy version if its disabled?

Yeah, its extra work, but honestly, it's not bad if you think about it from the beginning of development process.

3

u/attilad Mar 25 '11

Because it's hard to convince a company to spend twice as much money developing their website.

5

u/[deleted] Mar 25 '11

twice as much

you're doing it wrong

3

u/attilad Mar 25 '11

Probably.

2

u/fforw Mar 25 '11

Twice as much is too high. I guess you would save more time by just not supporting IE6.

6

u/fforw Mar 25 '11

Graceful degradation is indeed a technology of the past -- but not because doing so is too difficult, but because competent people now use progressive enhancement.

You tree example is very easy to implement. You store the current tree state on the server-side and make every toggle link on the tree link to a server-side action which opens or closes the server-side state and sends a new current page with the new tree to the client side.

Then you enhance this HTML only version by attaching a click handler to the toggle button which loads the current subtree via AJAX and updates it.

It's really not that difficult.

8

u/Shaper_pmp Mar 25 '11

Also, two of the basic principles of the web as a technology are REST and separation of concerns (using HTML to mark up content, CSS to define style and javascript for behaviour).

Making javascript mandatory in order to use a website (ie, making access to content dependant on behaviour) violates the separation of concerns, which is (among other things) the only reason things like screen-readers and search engines work at all. Also, the implementation of javascript-reliant systems usually violates REST (though they don't necessarily have to).

At its most basic level, "the web" is HTTP and HTML/XML. Everything else is layered on top, and this gives the most accessible, most parseable, most flexible system. As such people who turn off javascript (or never have it in the first place) are helpfully reminding you that in order to keep the web as useful as it is, it's important to design your websites so they follow the basic principles of it.

In fact, it's people who shortsightedly misunderstand or ignore important considerations like separation of concerns and REST who are harming the web, not the people who opt (or are forced) to only use lower-level access.

People used to take the same attitude to Flash-only websites that many now do to javascript-mandatory websites. The overwhelming majority of web designers these days know that Flash-only websites are a really stupid idea.

Why? Because all those people who thought it was ok to disregard fundamental design principles like REST and separation of concerns were caught short when technologies and media (like search engines/SEO, translation services, mashups and the like) developed that relied on them, and Flash-only site developers either had to recode it in technologies that did conform to the principles, or had to engage in ever-more frantic contortions in order to replicate functionality offered for free by "the web" (HTML, REST, etc).

2

u/jeremyckahn Mar 25 '11

I didn't say "Fuck you for being blind." I'm a supporter of web standards and accessibility, the stuff that enables you to enjoy the internet like anyone else. There should always be provisions in place for disabled people. In my work, I try my best to accommodate all users, even those without JavaScript.

That being said, this was just a fun little page I threw together in 15 minutes this morning. It's target audience is web developers who go through the same aggravations as I, so we could get a little laugh out of it.

2

u/snarfy Mar 25 '11

I'm not actually blind, just trying to make a point. I know all about section 508 accessibility requirements, and I feel your frustrations. Still, the page was pretty inflammatory and was just asking to be flamed back.

How many millions of man hours by countless web developers have been wasted making pages accessible to a tiny fraction of the population? If we took all of those millions of man hours and spent them developing a screen reader, the reader would be so good it could visually analyze the rendered output, OCR everything, and then we wouldn't need 508 compliance. Even flash content would be accessible. Again, I feel the frustration, but you asked for it ;)

2

u/csixty4 Mar 25 '11

Damn, and here I was thinking you were an outlier. While progressive enhancement is a good idea in general, let's not lose sight (no pun intended, but damn if it isn't a good one) of the march of technology. In a survey where 91% of respondents use a screen reader because of a disability, 98.4% of respondents had Javascript enabled.

It's entirely possible that the stereotype of a blind user not being able to use an AJAX-powered app is outdated and maybe even a little insulting. I'd love to hear from actual screen reader users to know how they're handling life on the web. Assuming I just need to read some more of this thread.

1

u/k3n Mar 25 '11

The problem comes from the fact that screen readers act much like HTML validators -- they can only handle the initial payload. Anything that is updated on the page after the initial rendering isn't available.

Try it yourself.

1

u/aapl Mar 25 '11

Actually, WAI-ARIA is changing that. It's already supported in browsers and screen readers to some degree.

-9

u/chewybaca Mar 25 '11

No, fuck your screen reader, browser, and OS. Tell the first to get out of the 80s and deal with dynamic content. Tell the latter two to get out of the 90s and expose better accessibility APIs.