Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
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) –  Carson63000 Dec 3 '10 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 '10 at 21:11
12  
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 '10 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 '10 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). –  Matthieu M. Jan 13 '11 at 17:59

27 Answers 27

up vote 46 down vote accepted

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

share|improve this answer
6  
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 '10 at 22:23
6  
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. –  meagar Dec 4 '10 at 0:59
17  
Oh.. so you are the people that have increased my work.. why, why o why.. ;) –  Roopesh Shenoy Dec 4 '10 at 14:28
20  
rather lame, why not just go back to using Telnet.... –  Darknight Dec 4 '10 at 16:36
16  
-1 Downvote, the OP asked if its worth the effort, you merely described how you browse! –  Darknight Dec 4 '10 at 16:56

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?

share|improve this answer
12  
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. –  robertpateii Dec 3 '10 at 20:35

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.

share|improve this answer
3  
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. –  David Thornley Dec 3 '10 at 21:06
19  
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 '10 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. –  Mason Wheeler Dec 3 '10 at 21:44
1  
+1 Popup blockers do a good job nowadays, for the most part. –  Jon Dec 3 '10 at 22:09
2  
@David Ad Block plus maybe? Free and easy to setup –  TheLQ Dec 3 '10 at 23:52

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.

share|improve this answer
1  
Nice answer. +1. –  Stephen Dec 3 '10 at 23:25

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.

share|improve this answer
2  
@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. –  Steve Evers Dec 3 '10 at 22:34

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.

share|improve this answer
2  
What is all the fuss with people disabling it? Am I missing something? –  Chris Dec 3 '10 at 19:56
8  
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 '10 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%. –  VirtuosiMedia Dec 3 '10 at 20:16
2  
Upvote for simply having a good, timely link on the topic. –  MIA Dec 4 '10 at 0:37
2  
Regardless of your numbers, you have to weigh the effort to create the user experience you want sans javascript against that 1-2%. For really rich sites I doubt it pays for itself. –  Matthew Frederick Dec 4 '10 at 2:03

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

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

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?

share|improve this answer
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 '10 at 0:06

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer
1  
Great. Well said. –  Stephen May 17 '11 at 19:54

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Only if the client explicitly requests it

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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