Pergunta

Should web developers continue to spend effort progressively enhancing our web applications with JavaScript, ensuring that features gracefully degrade, thereby ensuring accessibility? Or should we spend that time focused on new features or other areas of development?

The subtext of that question would be: How many of our customers/clients/users utilize our websites or applications with JavaScript disabled? Do you have any projects with requirements that specifically demand JavaScript functionality (almost all of mine do), and do those requirements also demand graceful degradation?

For the sake of asking this question, I pulled up programmers.stackexchange.com without JavaScript enabled, and I was greeted with this message: "Programmers - Stack Exchange works best with JavaScript enabled". It was difficult to log in, albeit the site seemed to generally work okay. (I wasn't able to vote up any questions.)

I think this is a satisfactory approach to development. Imagine the effort involved in making all of the site's features work with plain old HTML and server-side logic. On the other hand, I wonder how many users have been alienated by this approach.

We've all been trained (at least the good developers among us) to use progressive enhancement and to ensure our web applications' dynamic features degrade gracefully. Is this progressive enhancement just pissing into the wind, or do some of our customers actually utilize certain web services without JavaScript enabled?

Foi útil?

Solução

I use NoScript but whitelist any site I actually intend to use.

When you install NoScript, JavaScript, Java, Flash Silverlight and possibly other executable contents are blocked by default. You will be able to allow JavaScript/Java/... execution... selectively, on the sites you trust. You can allow a site to run scripts temporarily, if you're just surfing randomly, or permanently, when you visit it often and you really trust it. This means that NoScript learns from your own browser habits and tends to disappear in the background after a while, but it promptly comes back to save your day if you stumble upon a malicious web page.

When you browse a site containing blocked scripts a notification, similar to those issued by popup blocker, is shown.
Look at it or at the statusbar icon to know current NoScript permissions...

http://noscript.net/noscript/ss0.png

Outras dicas

I guess the percentage of people without JavaScript turned on is negligible. But be careful with search engine bots! They usually don't use JavaScript, but you wouldn't want them to skip some important content of yours because of that, right?

I always browse with JavaScript enabled and have since the dawn of the web browser.

Never once have I had a single issue that was worth degrading my browser experience over. Perhaps a few pop-ups or other annoyances, but the benefits far outweigh the risks in my opinion.

When using the console on Linux, I sometimes use Lynx when a GUI is not available. To the best of my knowledge lynx has no JavaScript support at all.

I've also used older mobile browsers with poor if any JavaScript support.

However in those circumstances I don't expect to get full usability from the site. I am usually just using the Internet to look something up quickly (e.g. get a phone number). Therefore I think that your site's non-JavaScript interface should be limited to a passive reference role. Stack Exchange is a great example of this, you can look up answers, but you can't up-vote. It's just there to be used as a reference.

I regularly surf the web from my smart phone's web browser when I'm not at home or the office. While it supports (at least a subset of) JavaScript it doesn't always handle it well. I've found many websites unusable because they either consume to many resources or just crash the browser.

I prefer the built-in browser, but I keep two alternate browsers around in case one of them does a better job.

One thing that hasn't been mentioned in this thread is what happens if your script breaks. In many cases, further execution of script on the page might be disabled, hence needing a way to fallback to a more simplistic way of navigating.

A script may break for various reasons, but the most obvious ones are incompleted requests for the .js files, various addons that might change the DOM (AdBlock, etc.) or introduce objects that aren't well namespaced.

This has nothing to do with people explicitly disabling script or whatever. As a side note, many modern routers, firewall software, etc. often have a feature to disable/filter out script, Flash, etc. from websites, so it might even be configured on a network layer leaving the user unaware of this (think public cafés, schools or other environments where other paranoid people have configured the access to Internet).

That is usually my main argument for developing sites that degrade gracefully, at least with the basic functionality of the site (layout and navigation).

The only thing that I disable JavaScript for is testing my own website. However, you might be interested in a study that Yahoo did that found between 1-2% of users have JavaScript disabled. Yahoo's audience is probably a pretty good representation of the average user.

A key quote from the study:

While 2% of U.S. visitors may not seem like a lot, keep in mind that over 300 million users visit the Yahoo! homepage each month. That means 6 million users visit each month without the benefit of JavaScript. So even though it’s worth spending your time on the JavaScript-enabled version of the site, there are still a non-trivial amount of users out there who won’t be able to use it.

I use NoScript along with the AdBlock Plus all the time.

The web today is too hostile (intrusive JavaScript + annoying ads) to go out unprotected.

You are, of course, getting a really skewed sample here, and you might do better to do your own research on your own site.

I, personally, use NoScript. I'm rarely reluctant to whitelist a site, but it does have to appear worth my while to do so. (In other words, I need a reason, but it doesn't have to be very convincing.)

Or do some of us actually utilize certain web services without JavaScript enabled

Yes.

My browsing falls into three categories.

Normal Browsing - On Safari or Chrome (Mac OS X)
- iGoogle, Stack Overflow, some blogs

Special websites: - Firefox, with NoScript, AdBlock Plus and FlashBlock
Sites with unnecessarily heavy JavaScript. (Some Indian sites for Bollywood movies/music, if that is important. Unnecessarily heavy script - the page itself reloads every 5 mins or so)

Mobile Browsing:
I used to have a Nokia 5310. Lost it. Now I have an even older Sony Ericsson W700i. I browse using it when I am traveling (Opera Mini is pretty good). This is the place (the absence of) JavaScript is a pain. I don't want to interact with the site (mostly), just read. Still most of the sites are impossible to view.

Just read Pragmatic Programmers "HTML5 and CSS3". The author says 5% of users have JavaScript turned off.

Here's his source: EU and US JavaScript Disabled Index numbers + Web Analytics data collection impact.

JavaScript Disabled Index numbers

EU: 1.4%
US: 3.05%

Source: 1.000.000.000 visits across multiple industry web properties using IndexTools.
(VisualRevenue.com/blog – Dennis R. Mortensen)

http://visualrevenue.com/media/uploaded_images/JavaScript-Disabled-735171.JPG

It looks like the percentage is falling too.

I tend to install NoScript and only whitelist sites that I trust. Otherwise I use the "allow temporarily" for specific domains when I need to.

This is just good security. Otherwise you're allowing an arbitrary amount of code to run on your machine! Even if it's sandboxed... there's always vulnerabilities.

Beyond my own habits, even if most people do browse with JavaScript, it's still useful to develop sites with progressive enhancement in mind. If your site is functional at the baseline it can service the largest audience. It also means that you separate your data from visual design and from business logic. Most of what you do with JavaScript on the client side should be done on the server side anyway -- doing it client side should just be a convenience given to a user of the site.

Of course there are exceptions that are going to require JavaScript, but generally there's an expectation involved. For example, there's an expectation to enable JavaScript for BioLab Disaster, a game, but none for a site like A List Apart, mostly just text.

When I'm filling out a form, should there really be an expectation that I have JavaScript enabled to submit the form? Why? So that the JavaScript code can check to make sure that I didn't enter a number instead of a letter?

Javascript is disabled by default for those of us on a Windows Server box. Our IT policy blocks so many sites, the only way to read some content is to surf on a server, where JS is disabled by default.

Although it isn't my preferred configuration, it's what I have to do sometimes.

I use Google Chrome + AdBlock Plus, and have JavaScript turned on.

EDIT: I use NotScript now. :)

Chrome ALONE blocks almost all popups (I've only found one site [Chess.com] that broke through once), and AdBlock gets rid of all the ads, so I have no problems with those.

IMO, JavaScript gives you a "better experience" overall, and as long as you visit trustworthy sites (that haven't been hacked...), you're fine. As "computer guys"/developers, I believe we should have a very keen "internet sense", and be able to tell if a site may be malicious.

In my opinion, accessibility trumps almost everything else. Users who rely on assistive technology should always be able to get most of the functionality of a site, even if it might take a bit longer. It doesn't matter how many percent of the users rely on it to matter. I am glad I code for an open source web project where accessibility is one of the main focuses and I actually learn how I can make things happen both ways - with and without JavaScript. (And lots of other things related to accessibility, because JavaScript or not is really only one small part of the problem.)

There is an interesting questionnaire that has answers from users of the project I just mentioned to what technology they use here. It might be of interest to you.

Hmm, now I feel like the Omega Man. :) Apparently I am the last person who does actually turn JavaScript (and cookies) off. (Unless I need it for a specific site like, say, Stack Overflow.)

I doubt I'm missing much - usually when I do turn on JavaScript for a site, it does something totally useless, like allow me to spew tons of personal information to total strangers, or shows me some moving ads - just what I wanted, some random movement on the screen while I'm trying to concentrate on reading an article...

I just answered a question on AskUbuntu.com -- I had to (temporarily - at the moment) enable JavaScript on the site. I use NoScript and enable JavaScript for a site when I think it is clear - but not until. By default, JavaScript is off for sites I've not visited before.

I do. NoScript all the way. I'll quit when browsers are sandboxed, and not before.

People keep talking about this decision as if it is binary. You either gracefully degrade or you do not. Instead, why don't you consider the costs vs. benefits of gracefully degrading for each individual feature? For example, you can make sure the site has basic functionality, but still require Javascript for someone to use specific features.

Also bear in mind that many people who disable Javascript do so because they want to use a light, stripped-down website with only the bare essentials. You could be spending all that time making your bells and whistles work for the users who are specifically trying to avoid them.

People complain that it is so much work to gracefully degrade. If you are complaining about how much work it is, then you are probably working on a feature it is worth requiring Javascript for.

It is my opinion that users without Javascript should always be able to navigate the site, use the contact page, and read any articles or blog posts you have. For any more complex functionality, make a judgement call based on the work vs benefit involved.

I only turn it of to browse Pr0n (bad neighborhood!) ;-)

I gave up trying to turn it off for regular browsing because things broke too much. And sometimes I do not even know that it was broken until I turned it back on.

If your site could be used by people with disabilities, it's a good idea to ensure that there is a backup to JavaScript.

Website strategy and planning is case specific. That is, a website can have no need at all to support IE browser, let alone thinking about minor issues like supporting border-radius of CSS3. But other websites may need even to be backward compatible up to IE6.

How can we understand what we have to plan for a website? Partly from our experience. Websites which target programmers and developers can get sure that their users use pretty new and updated browsers with almost all features turned on. However, news websites should think that someone from an unknown point of the earth can connect to their website to see what is passing insider his/her country.

But besides our experience and intuition, we also need to install some kind of analytics service on our website, so that our future decisions would be more robust, based on statistical data. For example Google Analytics is a very good tool. From there, you can see whether you really need to support older browsers or not.

However, if we want to follow Web Accessibility Guidelines from W3C, then we should definitely support lots of things, without considering site-specific circumstances.

In your special case, I say that no. We can safely forget about no-script in small and mid-level websites. But for bigger projects, it's not a bad idea to include a little more markup in your pages.

I can't decide whether some answers on this thread are hilarious or serious: cookies more dangerous than javascript ? LOL

Any site should be tested with js and cookies turned off however, it's a minimum imho.

Don't forget cookies. I consider cookies to be more dangerous than JavaScript. I used to be a NoScript user, but I have turned it off in favor of whitelisting cookie sites.

Only if the client explicitly requests it

Unless you have a significant number of users that will be effected, it's simply extra effort.

I always have JavaScript on. I also always have my minimum restore kit, at my side.

We need line veto disabling of JavaScript, so I could say "no alerts, no redirects, no websockets." The functionality is in WebKit at least, judging from the console and various inspectors.

But yes, always JavaScript on. Mainly because very soon people will use web sockets to wreak all sorts of evil, exactly like what happened when Flash got the "cool" VM. Then I'll turn off JavaScript. If they let me of course.

I want to enjoy as much of the good as I can. So I have some pleasant memories of this era. I want to be impressed, I want to giggle at the JavaScript follies, because I really miss what we had back in 2007, free sweet information flow like spring water, open sources everywhere.

I won't turn it off until I have to.

Booting from a live CD/DVD (physically or in a VM) makes me feel a lot better about allowing Flash and JavaScript to do their thing. If I remember correctly Linux Mint has Flash support out of the box.

As far as site development, I usually do a reasonable amount of div swapping and menus in JavaScript, but I try to make everything look right and basically work with CSS.

Rather than focusing on making sure an entire page degrades gracefully, I try to make sure about 75% (or more, if it's easily or quickly done) of the page gracefully degrades (or works sans JavaScript). I also try to make sure this 75% completes a whole part of the page's functionality.

For example, I use JavaScript to load comments for posts on my blog; It gave me flexibility, consistency in comment rendering, and it helps me maintain a self-imposed single query/request limit. However, the main reason why you're going to my blog - reading posts - remains server-generated and will work with any browser. Comments are completely self-contained in a clean .js file.

TL;DR The key here is what degrades gracefully, not how much degrades gracefully.

Licenciado em: CC-BY-SA com atribuição
scroll top