92

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?

14
  • 8
    This is not an answer to your question, but an additional anecdote that may be interesting: I have been working as a web developer in an agency environment for 4.5 years now, and in all that time, I have built one site for one client that asked us to ensure that it worked with JavaScript disabled - and that was a government department that wanted all Priority 1 checkpoints of the W3C's Web Content Accessibility Guidelines met (see guideline 6.3 - w3.org/TR/WAI-WEBCONTENT/#gl-new-technologies) Dec 3, 2010 at 20:20
  • 5
    I browser with NoScript on, and everything I build is designed to degrade nicely without JavaScript. Normally that means removing things entirely dependent on them or providing non-AJAX fallbacks.
    – Josh K
    Dec 3, 2010 at 21:11
  • 13
    Your purpose would be better served by asking the demographic of the website you are building. This is a site full of programmers - technically savvy people. They know what javascript is. And how to turn it off. They know how to get access to a javascript disabled browser. IMHO,an audience of say...bankers is bound to have far fewer visitors with javascript disabled. I guess you would need relevant data to determine this. Perhaps from the Analytics data of a relevant website.
    – rsman
    Dec 4, 2010 at 3:24
  • 1
    Sometimes JavaScript allows you to create tricks that act as security enhancements that you normally don't want to do without. For example to disallow abuse by bots posting comments or answers to this thread.
    – John K
    Dec 4, 2010 at 8:51
  • 3
    I pretty much assume Mobile Web Development is not concerned ? Because Nokia and BlackBerry have astonishingly bad browsers, and they NEED specific effort (unlike IPhone / Android). Jan 13, 2011 at 17:59

28 Answers 28

54

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

12
  • 8
    Same here; a web page has to earn the right to run scripts in my browser. I don't want to run scripts on every page I load from links from forums or other communities (like stackexchange) until I have a better idea what content I can expect to get in return.
    – PeterL
    Dec 3, 2010 at 22:23
  • 7
    I run a combination of NoScript, Ghostery and AdBlock. I can't agree enough with @Peter; websites must demonstrate both that they require JS and are worth my time before I'll enable it.
    – user229044
    Dec 4, 2010 at 0:59
  • 23
    Oh.. so you are the people that have increased my work.. why, why o why.. ;) Dec 4, 2010 at 14:28
  • 32
    rather lame, why not just go back to using Telnet....
    – Darknight
    Dec 4, 2010 at 16:36
  • 36
    -1 Downvote, the OP asked if its worth the effort, you merely described how you browse!
    – Darknight
    Dec 4, 2010 at 16:56
94

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?

3
  • 14
    I can't upvote this enough. your site doesn't need to look pretty with javascript off, but if it's not navigable your search engine rankings will suffer to some unknown degree. Dec 3, 2010 at 20:35
  • Right, all content should be accessible by links. +1. This is the heart of the progressive enhancement revolution, I would assume.
    – Stephen
    Dec 3, 2010 at 20:39
  • 1
    Related: w3.org/wiki/…
    – Pacerier
    May 12, 2014 at 9:54
47

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.

8
  • 4
    I'd say you've been lucky. My wife, along with a lot of other people, was once bitten by a New York Times ad. It seems that they rent out ad space, and not everybody in the chain is as diligent as they should be to stop malware. Dec 3, 2010 at 21:06
  • 22
    Okay. Say I get hit by some malware once in a while. I have virus protection enabled on my computer and I back everything up frequently. The total time I've spent in my computing life repairing the damage caused by malware is probably less than a week. I'm willing to deal take on this level of risk for a richer experience when using the internet. I'm not saying there is no risk involved, just that it is an acceptable risk for me.
    – JohnFx
    Dec 3, 2010 at 21:23
  • 2
    +1. I've seen a few banner ads that had malware on them. I knew they had malware because my virus scanner caught them and nothing bad happened. I reported the ads to the site admins, and they got taken down. Dec 3, 2010 at 21:44
  • 2
    @David Ad Block plus maybe? Free and easy to setup
    – TheLQ
    Dec 3, 2010 at 23:52
  • 2
    I find that hard to believe, since JavaScript didn't exist at the dawn of the web browser. Dec 5, 2010 at 1:36
23

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.

2
  • Is it worth spending an extra $x thousand, and days or weeks of work, to ensure that the site gracefully degrades on the off-chance that one nerd who occasionally uses a command line browser will visit it? If the website is about how to use the command line, then maybe...
    – Ant
    May 16, 2011 at 8:32
  • @Ant, I agree if it would cost thousands of dollars or that equivalent in work time, and command line users, NoScript users, and older mobile browsers are all unlikely to be regular users of your site, then there is nothing wrong with requiring JavaScript and failing to gracefully degrade. Although I think there should still be a warning displayed to non-JavaScript users in that case.
    – Adam
    May 16, 2011 at 15:55
17

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.

4
  • I think this one may be a bigger issue than people surfing from their desktops with javascript off. With smart phones getting more powerful daily, it may go away soon though. Unfortunately I'm out of up votes for the day though :P
    – BlackICE
    Dec 3, 2010 at 20:52
  • 3
    @David: Smart phones are getting more powerful daily, but people aren't buying them daily... afaik, most reasonable contracts lock you into your phone for a few years before you can get a new one without paying through the nose. Dec 3, 2010 at 22:34
  • @SteveEvers Lol, reading this comment at the end of 2015 is funny.
    – J.Todd
    Dec 5, 2015 at 17:17
  • @Viziionary yes it is. :) Dec 5, 2015 at 18:02
13

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).

2
  • What an excellent point of view. Thinking along these lines, what's your take on this quote? programmers.stackexchange.com/questions/23535/…
    – Stephen
    Dec 4, 2010 at 14:56
  • I don't know how these scenarios would affect statistics, but would assume that most of it wouldn't add to the amount of user that has javascript explicitly disabled. I bet most of them are based on some triggers that are invoked upon page load, while javascript might break at runtime when the statistics has already been collected.
    – jishi
    Dec 4, 2010 at 17:55
12

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.

13
  • 2
    What is all the fuss with people disabling it? Am I missing something?
    – Chris
    Dec 3, 2010 at 19:56
  • 9
    That quote is misleading. It uses big numbers to scare you. But a percentage is a percentage, regardless of the sample set. So if one thousand people actually use my service, by those numbers ten or twenty of them are going to show up without JavaScript enabled. I'm thinking the effort involved in giving them a reasonable experience isn't worth it! It's downright expensive, really! I should just give those people a message that says "You're going to have to trust me and turn on JavaScript."
    – Stephen
    Dec 3, 2010 at 20:03
  • 7
    @Stephen - It totally depends on your audience and business model. If you have a large audience like Yahoo, 1-2% could mean a lot in terms of revenue lost. For a smaller audience, the cost of progressive development might outweigh the loss of revenue. Another corollary is IE6 support. I'm dropping it in my upcoming redesign because my audience using IE6 is around the same: 1-2%. Dec 3, 2010 at 20:16
  • 2
    Upvote for simply having a good, timely link on the topic.
    – MIA
    Dec 4, 2010 at 0:37
  • 3
    @Eiko Or, you could develop the site so it degrades properly. You know, have some standards and all that.
    – user229044
    Dec 5, 2010 at 5:30
7

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.

1
  • Ghostery​​​​​​​​​​​​​
    – Pacerier
    May 12, 2014 at 9:17
6

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.)

2
  • But if you do your own research on your own site, you should keep in mind that you will very likely get a biased sample. If your site is broken without JavaScript, then the fact that most of your users have JavaScript enabled shouldn't be too much of a surprise, since those without JavaScript have long since switched to your competitors ... Dec 5, 2010 at 2:06
  • exactly, I remember having read a lot of people turned Javascript off by mistake. Obviously that wouldn't happen to most of us here. Dec 7, 2010 at 14:04
5

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?

2
  • Personally, I never read websites like A list apart in a "real" web browser (because it is only text): only using a rss reader or via instapaper, but I can see your point.
    – wildpeaks
    Dec 4, 2010 at 0:03
  • 1
    Also, a website that requires javascript to submit a form has misunderstood the concept of progressive enhancement, but I still believe that turning off js just because somewhere someone might use an annoying animation or some bs is like "turning off images because someone somewhere might use an annoying image": you're losing more than you gain.
    – wildpeaks
    Dec 4, 2010 at 0:06
5

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.

5

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.

2
  • How relevant are stats from 2006-2007? If the trends of those data points continue on a linear path, then the numbers would be less than zero in 2013. Aug 5, 2013 at 14:23
  • @KristopherJohnson, It will stop being linear after a threshold, this is common sense. Unrelated info: 1% of the world population is 70m people.
    – Pacerier
    May 12, 2014 at 9:20
3

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.

3

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.

1
  • There is absolutely no such thing as a trustworthy site that sells ad space. The New York Times site once infected my wife's computer. Sites like that sell space to ad resellers, and there's no guarantee of due diligence along the line. Dec 5, 2010 at 17:42
3

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.

1
  • You're describing accessibility in a different context, I think. The discussion here would be the impact of disabling JavaScript for all users, not the impact it has on a subset of those users.
    – Stephen
    Jan 28, 2011 at 20:18
2

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...

2

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.

2

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

2
  • Well a lot of modern internet security suites sandbox major browsers.
    – Orbling
    Dec 4, 2010 at 1:35
  • on osX sandbox is here man -k sandbox, go into the *.app find the executable and change it to run in your sandbox ;)
    – chiggsy
    Dec 4, 2010 at 2:36
2

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.

1
  • 1
    Great. Well said.
    – Stephen
    May 17, 2011 at 19:54
1

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.

1

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

1

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.

0
0

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.

0

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.

1
0

Only if the client explicitly requests it

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

1
  • Users won't request these things from you. They will just leave.
    – Pacerier
    May 12, 2014 at 9:23
0

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.

0

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.

-1

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.