111

Should I bother to develop for JavaScript disabled?

I feel that my time is better spent developing for the majority.

gnat
  • 21,442
  • 29
  • 112
  • 288
Jiew Meng
  • 2,261
  • 3
  • 20
  • 26
  • 18
    Your time would be better spent building a working site, and that includes supporting disabled javascript as much as possible. – Adam Lear Dec 13 '10 at 13:50
  • 5
    I personally browse most sites with JavaScript disabled. – SingleNegationElimination Dec 13 '10 at 14:47
  • 5
    ah, @TokenMacGuy, may I ask why? – Jiew Meng Dec 13 '10 at 15:08
  • 2
    Even if you are developing something that must rely on javascript you need to remember that even flawless javascript can overwhelm smaller devices/browsers. As more devices get the ability to browse the web I think web developers are going to have to rely less on javascript not more. – Bill Dec 13 '10 at 16:18
  • 1
    duplicate of http://webmasters.stackexchange.com/questions/1115/can-we-ignore-visitors-without-javascript-enabled and http://webmasters.stackexchange.com/questions/4733/should-i-worry-about-people-disabling-javascript – HoLyVieR Dec 13 '10 at 20:43
  • 1
    @Anna Lear: That entirely depends on the circumstances of the site and who it is for. – Macneil Dec 16 '10 at 01:50
  • Ok, can you change the question a bit. The answers are a bit confusing. Some are answering - `Should i bother to develop for js disabled?` while others are answering - `is my time better spent elsewhere?`. – Derek Adair Dec 22 '10 at 05:22
  • Also see: http://programmers.stackexchange.com/questions/26179/why-do-people-disable-javascript – haylem Feb 29 '12 at 01:32
  • @Derek Adair - if your time is better spent elsewhere you shouldn't bother developing for js disabled. If you should bother developing for js disabled, at least some of your time is better spent on that than on other things. I don't see how these are two different issues. –  Jan 16 '13 at 00:54
  • 2
    Yes. The main reason I installed NoScript and Flashblock, becuase many sites are stuffed with suboptimal and slow scripts and flash animations, which makes the browser very slow. With disabled scripts I can have 20-30 tabs open without continuous 100% CPU usage, and pages usually render very fast. – Calmarius May 14 '13 at 11:24
  • 1
    It really depends on the requirements. What does the contract say? Is it reasonable to ask the users of your site to enable JavaScript? Can you deliver a significant portion of your site's feature set without? – user281377 Dec 13 '10 at 14:01
  • 3
    we need a new answer for 2016 – SuperUberDuper Feb 24 '16 at 14:08
  • Is `````` developing for javascript disabled? – J.Money Dec 02 '18 at 23:08

20 Answers20

74

There's a web-design philosophy known as Progressive Enhancement which is one you should consider. The idea is you build a basic site that is usable and workable, and then you layer onto this enhancements like jQuery and browser-specific stuff to "enhance" it. This way you get a site that works for everybody and looks nice for the majority.

If that doesn't convince you, then consider other reasons for having a site work without javascript:

  • It is more SEO friendly. If your site relies on JS for content and links then chances are search-engines will be ignoring large chunks of it.

  • Imagine you are an eCommerce site selling widgets. Now, even if only 5% of your customers disable javascript, that is a potential sales loss of 5%. Is it worth losing customers over?

  • Don't discriminate against the disabled. Relying on javascript means your site is not accessible and, in some cases (such as government/public sector sites), you could be breaking the law by discriminating against people.

NullUserException
  • 840
  • 1
  • 6
  • 15
Dan Diplo
  • 3,900
  • 1
  • 27
  • 30
  • +1 for "more SEO friendly" – tcrosley Dec 13 '10 at 22:41
  • Discrimination? Is there seriously a law about this? Seems just like any regular old dependency.. – alternative May 12 '11 at 00:26
  • 8
    Yes, in the UK it is law that disabled people should not be discriminated against and this is something all public-sector (government funded) websites have to adhere to. See http://www.direct.gov.uk/en/DisabledPeople/RightsAndObligations/DisabilityRights/DG_4001068 and http://www.rnib.org.uk/professionals/webaccessibility/lawsandstandards/Pages/uk_law.aspx – Dan Diplo May 12 '11 at 10:10
  • It's also the law in the United States of America (see http://www.section508.gov/). – Zian Choy Nov 11 '12 at 02:23
  • 31
    Relying on javascript does not mean the page is not accessible. Screen readers are perfectly capable of running javascript, and there are standards for accessibility in rich web applications. http://www.w3.org/WAI/intro/aria.php – Russell Leggett Jan 16 '13 at 07:44
  • 2
    In addition, say something happens and your javascript breaks, or the latest browser update has rendered your javascript code not to work, or some other "one off" issue - you still want your users to be able to user your site normally. – Cody Jan 16 '13 at 07:57
  • I don't think this answer deals with the question at all, it just suggests a different way of bothering to develop for disabled JavaScript. – Luke Puplett May 28 '14 at 12:09
  • 1
    @DanDiplo What about web apps that cannot be made without JavaScript? Does that mean that web apps are illegal in the UK due to their lack of support for the disabled? What about support for those who are blind and deaf? If we really wanted to support people like that, websites would need to have the ability to interface with a braille printer or something. I'd like to support the disabled as much as possible within development reason, but where do we draw the line? – AmadeusDrZaius Sep 19 '14 at 18:15
  • 1
    Also important -- according to this site 98% of screen readers have JS enabled: http://webaim.org/projects/screenreadersurvey4/#javascript – AmadeusDrZaius Sep 19 '14 at 18:53
  • 2
    @AmadeusDrZaius You have to realise this was originally answered in 2011 and a lot has changed since then in terms of screen readers and search-engines and their ability to support JavaScript. I'd still argue that in a lot of cases it still makes sense to have apps that degrade nicely, but acknowledge that there will be certain rich apps that rely totally on JS. – Dan Diplo Sep 20 '14 at 19:18
  • "Bothering to develop" for the Javascript impaired may not be the easiest thing to do, but it's the right thing to do :) – Matt Borja Jun 18 '15 at 19:23
  • "You could be breaking the law by discriminating against people...", I lol:ed. – theodore hogberg Jun 30 '15 at 11:15
  • 1
    If you expect a functional site to use the web without javascript I advise that you disconnect your internet connection. – SuperUberDuper Feb 24 '16 at 13:13
49

For one, I disagree with the people out there who insist that everything should function without Javascript. It is nice to code to the lowest common denominator in a lot of cases (for example, I would be really pissed if my bank's site required Flash or some such nonsense.) But realistically almost everyone has Javascript enabled these days and if used properly the resulting sites can be quite spectacular and useful! (I mean, let's see how nice Google Maps is when Javascript is turned off...)

However, this should not absolve you from at the very least ensuring that your page fails gracefully if Javascript is not present. Never EVER leave your users staring at a half loaded, broken page with no indication as to what went wrong. Just ask yourself: Would I rather spend 2 minutes coding up a "This page requires Javascript" message or receive 10 emails daily from users telling me that my page is broken because they have noscript enabled?

Toji
  • 181
  • 1
  • 5
  • 47
    "But realistically almost everyone has Javascript enabled these days"... And those who don't are well aware what they're getting themselves into. – Dan Ray Dec 13 '10 at 22:01
  • 7
    Be sure to consider your target audience. If your target is tech-savvy, security conscious people a much larger majority of your readers will be running NoScript. If they are like me, when they hit a site through a search link and that site offers nothing useful without javascript, I immediately hit Back and look at the next site on the list. – Zan Lynx Sep 30 '11 at 20:41
  • 3
    You should also consider the contents of your website. A website focusing on displaying data doesn't need Javascript, but I've yet to see a game working without it. – DistantEcho Jan 16 '13 at 09:00
  • 1
    My bank actually requires a Java applet to enter the password to log in. These keyboard things most people have attached to their computer are so old school. I have some extra paper bags in case anyone else needs to vomit. – Mike Jul 08 '13 at 19:16
  • @Mike: Then switch bank. If I were you, I wouldn't trust them my money. – ybungalobill Jun 20 '15 at 22:46
  • @ybungalobill Believe me, I would if I could. – Mike Jun 22 '15 at 03:32
41

Yes, you should.

If you perceive this as something that requires extra effort, you may be doing it the other way around.

Develop your pages to work without JavaScript first then add JavaScript-based improvements, Ajax effects and so on. They will work if JS is supported/enabled, otherwise your pages will degrade gracefully.

And please, don't develop the pages where:

  1. The entire content is pulled from the database by JavaScript

  2. The markup completely falls apart because the elements glued together and put into the right places by JavaScript not by CSS

  3. Links in the navigation and in the body are not functioning without JavaScript (unless it's some framework like ASP.NET which relies on JavaScript for a reason)

It's just against the spirit of the web and against the common sense.

P.S. Spoken by a user of the NoScript.

  • 27
    So instead of delivering features for the 99% of people with javascript turned on, I should bust my hump making everything either: not use javascript, or worse, do everything 2 ways so it gracefully degrades? I feel the same way about turning off cookies. It's almost 2011, you should expect sites to be pretty much broken without javascript. – Hardwareguy Dec 13 '10 at 14:25
  • 36
    No, in 2011 I actually expect JS-broken sites to be finally fixed. –  Dec 13 '10 at 14:32
  • 14
    I think the onus is more on you as a noscripter to decide if a site is worth turning on javascript than for the sites to bend over backwards for the minority. – Hardwareguy Dec 13 '10 at 14:35
  • 7
    Well if you're relying on JS where you don't in fact need it, you're doing it wrong. As good time as any to start doing things right. –  Dec 13 '10 at 14:47
  • 3
    How about charity and government sites which are required by law to have certain usability requirements. I had to develop a site for a major charity, it works great with JS turned off but still has nice JS enchacnemnts that make the site a bit more responsive and modern. – Neil Aitken Dec 13 '10 at 15:21
  • 9
    +1 for developing first without JS, then adding enhancements. This has been the proper way to create web sites for ages. If your site doesn't work for the base case (a simple browser like one might find on the old computer your grandmother uses, the mobile you use, and the search indexer a large search provider uses), you really don't have any idea when you might be losing views/sales. Developing for no JS isn't difficult. No JS users don't need all the flashy animations and rounded boxes, but the site better *work*. – PeterL Dec 14 '10 at 00:43
  • 2
    The StackOverflow team put lots of effort into making the site degrade gracefully in browsers without JavaScript. The only browser I use that doesn't have JavaScript is the one in my crappy Blackberry Pearl, which won't load StackOverflow because *the webpages contain too much data*. Trying to design for obsolete browsers for crap platforms/your grandmother is a waste of time because there are probably other problems - IE6's rendering engine, for example - that you'll spend far more time on. Making your site work for disabled users, etc, is, however, a worthwhile goal. – Ant Dec 17 '10 at 16:14
  • @Ant: At the last census we did, 25% of the users of the website I am working where still using IE6 ... so we need to accomodate its engine, indeed (even though we definitely don't make the site slick there). We were tempted to use "You are using an obsolete browser" banner... – Matthieu M. May 26 '11 at 17:36
  • If you expect my web application (that is providing a service to you) to run without javascript then I don't want your business. – SuperUberDuper Feb 24 '16 at 13:23
34

As a developer I no longer worry about 1% of users who turn off Javascript. It is too time consuming and development time is too expensive to waste on such nonsense. AJAX saves an incredible amount of bandwidth which turns directly into $$$ savings, which makes profits higer. If I lose oneor two potential users of the site for every 100 users, those one or two lost users will cost a lot more in development than the potential income of they could ever bring in.

Try turning off Javascript and logging into Facebook, it becomes a very broken website after that. If it's good enough for Facebook, its good enough for me.

Robert
  • 1
  • 2
  • 2
  • 8
    I totally agree with you. One small issue though: you should have some sort of warning message for the user if he's part of those 1 or 2 percent. Maybe he unintentionally disabled JS. – Radu Murzea May 28 '13 at 12:54
  • If your website only shows a blank page or the layout falls appart completely with disabled JS, you probably do something wrong. – Calmarius Dec 11 '13 at 12:13
  • 1
    1000% agree, who cares about that 1% – SuperUberDuper Feb 24 '16 at 13:23
12

Personally I use the NoScripts Firefox plugin when browsing, and I encourage others to use it to. On all the family PCs I maintain NoScripts is one of the mandatory bits of software I install. I set it up with a whitelist of the basic email and banking websites along with the popular social & video sites and explain to them how the temporary allow works. Judging from the popularity of this plugin I think there is a pretty good portion of people who use it.

At the very least I expect navigation functionality to work without scripts. If you have something specific like video that requires scripts then fine, but display a nice placeholder that says "scripts are required to view this video".

Making your navigation rely on scripts is a big mistake though. In many cases it will make me bounce off the site in disgust. An even bigger mistake is to have part of your site or navigation just completely disappear when scripts are disabled. Unless you highlight the fact that something is missing there's a good chance I won't even notice so will just leave your site thinking it wasn't there. Also, a full screen message that just says "this site requires scripts" won't get you very far, I need to see some level of content before I trust you enough to allows scripts.

Finally, don't forget that it's not just desktop PCs that are browsing your site, but mobile browsers are increasingly popular. Although mobile JavaScript support is getting better it's no where near perfect so unless you are going to heavily test all the different mobile browsers I would suggest you search the mobile version of your page pretty much scriptless.

Simon P Stevens
  • 1,906
  • 14
  • 20
9

Absolutely

A site that doesn't work correctly without JavaScript should clearly notify the user. As much as possible should be made to work correctly without JavaScript. There are certain cases where this won't be possible, highly dynamic sites built on layers of AJAX and remote fetches are one of them. This doesn't mean that it's okay to show a blank page if I have JavaScript disabled.

Graceful degradation is extremely important, and it doesn't just apply to JavaScript, it applies to everything you code. Valid HTML markup, valid CSS, server side validation of everything.

Josh K
  • 23,019
  • 10
  • 65
  • 100
9

Can I recommend an article from "A List Apart"?:

Progressive Enhancement with JavaScript

...We’ve reviewed the mindset needed to implement progressive enhancement in JavaScript and several techniques through which to do it. We’ve also touched on the concept of unobtrusive scripting and learned a little about how to manage the inter-relationship of CSS and JavaScript.

When you combine the general approach with that article with useful tools like JQuery (or Prototype, or whatever your JavaScript framework of choice is), it's really trivial to apply the JavaScript behavior after the fact.

There are several types of browsers out there that still do not have JavaScript or at least very limited JavaScript support. Not to mention that rule #1 for both WCAG and section 508 compliance (accessibility for non-US folks) is that the sight does not depend on a scripting language to function. If the page reloads every time I make a change, but it still allows me to make changes it is functioning. The AJAX layer on top of the base site makes it possible for me to do the same without the page reloads.

Top reasons I can see for supporting no JavaScript users are:

  • Supporting folks with disabilities (screen readers, alternate input devices, etc.)
  • Supporting security conscious people: let's face it there's bad people doing heinous things with JavaScript, so the easiest solution is to get rid of JavaScript
  • It's the easiest way to disable ads without a plugin
  • Mobile and embedded devices
  • Command line browsers used to download tools on headless servers
  • Search engine spiders only follow real links--JavaScript confuses them

Please, if you are going to require cookies and JavaScript on your site for it to function, then properly do your due diligence to avoid the following problems with the following:

  • Cross-site scripting attacks
  • 3rd party user tracking
  • Hacking/Defacement through DOM manipulation
  • Phishing (if a script can access your DOM, it can send any information on the page to the server it was loaded from)

(And that's just the short list)

When the solution isn't that hard, why not do it?

Also, while you're at your JavaScript fiesta, don't forget to support sane keyboard navigation.

gnat
  • 21,442
  • 29
  • 112
  • 288
Berin Loritsch
  • 45,784
  • 7
  • 87
  • 160
9

It depends on the site and who will be using it.

Is the site public or is it an intranet or a site that will only be available to certain customers? You will probably encounter users without JavaScript in the public. If it will only be used by clients can you tell them you only support JavaScript enabled?

Is SEO a consideration or is the entire site behind a log-in screen or SEO is it otherwise not a factor? It is much easier to optimize for search engines if there's no JavaScript.

Will the site ever be used on mobile browsers? Mobile browsers often have no or poor JavaScript support.

You should also realize that JavaScript can make it difficult for screen readers to process your site and has other potentially negative accessibility considerations.

Users of text based browsers (e.g. lynx) also have little or no JavaScript support.

You have to look at your site and your audience and decide if you need to support users who have JavaScript disabled. You also have to see if it's even possible not to use JavaScript. If you're making an advanced Web Application and need things like webcam and microphone support it may be impossible to not use JavaScript.

If you decide that you need to support users without JavaScript then you can still use JavaScript. You should just make the website still functional without it. This is called progressive enhancement, it should gracefully degrade if there is no JavaScript support.

If you decide to require JavaScript you should notify your users (using the <noscript> tag) that you are doing so.

Adam
  • 2,141
  • 2
  • 16
  • 15
4

< 5% of users disable javascript

According to BrowserStatistics, in 2008, only 5% of users had JavaScript turned off. The trend has steadily been declining so it's very safe to assume that now near 2011, that number is much smaller.

Downgrade Gradefully

Your site should never be broken - no matter if the users have JS on or off. Even if it's as simple as displaying a message that your site needs javascript turned on, you should make sure that your website renders and behaves in an acceptable, non-broken manner for those select few.

Reworking for non-JS users? Normally: No.

The ordinary developer has no need to create a non-javascript version in another language. However, if it is known that your clients have anti-javascript needs, then you obviously are forced to cater to it. (Even GMail has a no-JS version)

rlb.usa
  • 961
  • 9
  • 18
4

On a site like this you will find many developers tell you how they have Javascript disabled so you should support progressive enhancement. In reality of the 5% of people who have Javascript disabled, 90% of them are developers and other tech geeks, they are not the general public. Most major sites do not support progressive enhancement. Have you tried to use Facebook without Javascript? They basically say go away.

Craig
  • 4,302
  • 3
  • 21
  • 21
2

My thoughts:

Using javascript will always increase the surface area for attack, not just for you, but for your customers - almost everyone I know browses with NoScript, and this includes non-technical folks.

If I see an online shopping site that uses javascript badly I will not buy from them. I always first browse with javascript disabled, and if a site degrades gracefully I may be interested. If it is just broken I will usually assume the programmers also don't have the capability to deliver a secure shop platform.

It tends to slow everything down - despite being close to a major city, my broadband is slow enough without having to wait for some marketing idea to load. If a site takes more than 5 seconds to load basic content then I won't bother unless I have a real need.

Rory Alsop
  • 326
  • 3
  • 12
1

Most of the answers here appear to highlight criticisms of standard websites using JavaScript in non-essential or hacky ways. But what about web apps? There are a ton of critical functions that cannot be achieved even remotely as effectively without JavaScript. Even something as simple as a basic word counter under a text area, or enabling/disabling an additional form question based on the answer to another. In this case is it not reasonable to build for the majority and degrade gracefully for the minority? Especially if you know that your user base is non-technical and unlikely to have JS disabled?

Jordan
  • 1
  • 1
  • If the purpose of a page is to do something that requires JavaScript, then it's perfectly reasonable to require it. If, however, the purpose of a page is to allow people to allow people to download software for their Blu-Ray player, then a form where the user inputs a whole or partial model number, submits it via POST, and receives a page listing suitable files and the models they support, may be just about as functional as anything Javascript can do. – supercat Jul 20 '14 at 19:05
1

Only on mission critical functionality

Generally its a good idea to "degrade gracefully". However I would I would only concentrate on mission critical parts of your web application, to cater for situations when JavaScript may not be available.

If its just "bells & Whistles" effects, then no don't bother. People who deliberately surf with out JavaScript will just have to make do a plain experience (hey that's their choice for not using Js)

Darknight
  • 12,209
  • 1
  • 38
  • 58
0

Depends on the answer to a single question:

"Is the cost of supporting users with Javascript disabled greater than or less than the money lost by not supporting those users?"

Say your website has a lifespan of 3 years before needing to be rebuilt, it costs £30,000 to build for 'rich clients', and you add another £10,000 to support non-javascript users (of which we'll assume there are 5% of)

If the missing 5% of users would have spent more than £10,000 - do it. If they wouldn't, don't do it unless you're legally required to.

This is more of a business/economical decision than a technical one.

PhonicUK
  • 1,047
  • 3
  • 11
  • 12
0

Things to consider:

AFAIK, search engine spiders don't like Javascript. You should have basic content and navigation without Javascript just for SEO.

Some websites may have rules for access by the disabled, either for legal reasons or for company policy. That is usually best accomplished with simple HTML as opposed to Javascript.

While most people surf with Javascript on nowadays, that isn't a guarantee for the future. The web is becoming increasingly hostile, and tools like NoScript may become more popular. Alternately, it's possible that more people will use devices with less capable browsers, although with some Android phones being fairly inexpensive this seems less likely. Graceful degradation may be a way of future-proofing the site.

David Thornley
  • 20,238
  • 2
  • 55
  • 82
0

Yes.

I'm not going to talk about people with NoScript, embedded devices, etc. Their share can be measured and then you can decide if revenue decrease caused by annoying e.g. 0.5% users worths implementing a solution for them.

But there are other reasons to follow Progressive Enhancement principle, and they are often more important.

  1. 100% users can't execute javascript before scripts are loaded. If site can work without js, it can be loaded faster for the first-time visitors, visitors with empty cache and for all visitors after js code updates.

  2. Sites that can work without js are more reliable. Javascript error breaking a website is an architectural nightmare. More info on this and related problems: http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs

  3. It is easier to stick to Progressive Enhancement than to implement SEO-friendly javascript-only site.

  4. It is easier to write automated tests for site that doesn't require javascript to work.

It is actually quite easy to follow Progressive Enhancement principle so why don't follow it?

Mike Korobov
  • 111
  • 2
-1

It depends very much on your target market. If your target market is non-techs, you're pretty safe ignoring javascript disabled. However, if you're after techies, well, the majority of the ones I know have javascript disabled... You're going to need to support them unless you want the small portion of techies that allows javascript (I'm one of the minority, I let javascript run on my machines). :-)

Brian Knoblauch
  • 4,170
  • 1
  • 17
  • 20
-1

No, you shouldn't

With two exceptions:

  1. Content you want to be search engine indexable. (That doesn't mean it has to look good - as long as the links work and the content is discoverable.)
  2. Simple mobile sites that must work on all devices. (Some BlackBerries have JS disabled by default, and many non-smart phones often don't have it at all.)

For desktop and touch phone websites, Javascript provides an amazingly rich user experience. There is a reason all top websites make extensive use of AJAX and Javascript. All current browsers support it. Embrace it!

As someone who has sweated in the past to make an entire website work with Javascript disabled, I can assure anyone that they'll end up degrading the experience for the 99% in order to please the 1%.

Rather just stick in a NOSCRIPT tag that tells those users to enable Javascript. They'll be used to it.

realworldcoder
  • 1,690
  • 1
  • 11
  • 16
  • I would add one more exception: You need to make sure your site doesn't have security holes that only manifest themselves when Javascript is disabled. – Kyralessa Dec 14 '10 at 01:40
-2

JavaScript disabled is extremely important and you should support it. The porn industry is notorious for spamming users with rogue pop-ups. Disabling JavaScript is pretty much required if you navigate into this territory.

Do you really want to force users to constantly turn JavaScript on/off as they go from sites of questionable repute to your app?

jojo
  • 598
  • 3
  • 4
-3

Why would you use JavaScript? It's not necessary for anything useful anyway. Add it for silly effects if you want, but make it work for us sitting on a new but slow netbook/iPod/whatever wanting it to work a little faster (and safer) by turning of JavaScript!