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.

Apparently less than 1% had javascript off in 2010: http://developer.yahoo.com/blogs/ydn/posts/2010/10/how-many-users-have-javascript-disabled/

So is it worth it to still support browsing without javascript?

For example:

Form submissions. Normally I would set up click or change events on form elements and just update the current page HTML from the response. But if the user has js disabled, the form cannot be submitted, and it won't work.

If I have to take into consideration that the user has JS off, then I need to wrap my input elements within <FORM>, add a submit button and add additional mark-up on the current page to handle the form submission results... Anyway there's a lot of extra work to do in this case.

Another example - replacing generic form elements with DIVS that you style to look like cooler input elements, and make them behave like generic inputs trough JS. Again, users without js won't be able to do anything with them.

Or a different example, the UI created by JS on page load. Besides the fact that non-js browser won't display the UI, there's also a small problem with JS-capable browsers which will show a ugly UI until the page is full loaded and the JS gets to be executed.

Are these drawbacks important enough to take into consideration, when less than 1% of your visitors are affected by them?

share|improve this question
1  
5  
The biggest problem is more about SEO than non-js users IMHO. –  Florian Margaine May 17 '12 at 12:26
    
I found this: seomoz.org/blog/how-to-allow-google-to-crawl-ajax-content Perhaps you can make Google crawl stuff from the ajax response? –  Alexa May 17 '12 at 12:41
    
is your portion of profitable customers that don't have javascript enabled large enough to pay for the extra effort? –  Jarrod Roberson May 17 '12 at 22:14
    
Let's not forget there are services such as Instapaper and Readability that may not work correctly if you aren't at least testing basic functionality without JavaScript enabled. –  user109869 Nov 27 '13 at 3:10
add comment

2 Answers

up vote 11 down vote accepted

First of all; I'd put some question marks on that 1% figure. How did they measure this in the first place? Most usage statistics are collected client-side, using (drum roll) javascript. Disabling javascript completely means you're not counting those users. Furthermore, most of the script-aware users use things like NoScript, which is far more sophisticated than a simple "turn all javascript off"; instead, there's a whitelist, a blacklist, and a per-case decision for the gray area. I use NoScript myself, and more often than not, I only allow those scripts on a site that it needs to function, while Analytics and other tracking sites are tossed on the blacklist. So I probably count as "javascript enabled", even though I default to "javascript off", and serving me something that looks broken until I enable Javascript makes a bad impression - enough to make me close the page within a second unless I know it has what I need.

But let's assume the 1% figure is accurate. The fact that some users browse scriptlessly isn't your biggest concern. You should also consider the following:

  • Accessibility. While you can write accessible javascript, it is very hard to get it right, and you need to test on a wide array of user agents and configurations. If, however, your site is written in clear semantic HTML and functions well without Javascript enabled, it is typically easy to get accessibility right.
  • SEO. Most search engine spiders don't execute Javascript, and if they do, they don't typically go all the way. So basically all content that you generate or pull in using Javascript is invisible to search engines.
  • Integration with third-party tools. One of the great things about HTML is that it is a well-defined, standardized textual data format. Thousands of tools can process it to perform all sorts of tasks, and the ability to transform and accumulate your content adds value to your site. If you rely on javascript to display it, most of these tools will break.
  • Security. While Javascript is not inherently insecure, moving application logic to the client has important security consequences, and it's easy to overlook issues.
  • Mobile devices. Not all smartphones have the processing power to run your javascript as smoothly as you'd need it; many mobile browsers don't even support the full feature set of a desktop browser's javascript engine; and the very nature of the device (small screen, limited input devices, touch screen rather than a mouse) may break quite a few javascript / DOM features you might take for granted.
share|improve this answer
1  
The only point I would add to this is mobile. Having a site that runs without JS or even mostly without JS can be really nice when somebody decides aging Blackberry or feature phone support is hugely important. –  Erik Reppen May 17 '12 at 14:06
1  
I can think of a couple of ways to count how many clients have javascript disabled, it really wouldn't be that hard. You'd just have to ask the client to do an ajax ping when they get the page. If you don't get the ajax ping back, then the client might have javascript disabled - especially if they keep on browsing your pages. –  Tacroy May 17 '12 at 16:29
    
@Tacroy: Yes, I know it can be done. The point is that none of the off-the-shelf solutions for visitor tracking that I am aware of does it - they're all either all server-side (examining log files), or all client-side (using javascript). –  tdammers May 17 '12 at 21:19
    
@ErikReppen: Thanks, added. –  tdammers May 17 '12 at 21:23
add comment

tdammers hits a number of key issues. Here are a few more.

Who is in that 1% of non-users? Given that JS is enabled by default, they went in and turned it off on purpose. That implies a degree of technology knowledge and sophistication. Quite possibly, those are the alphas (early adopters) and near-alphas that you need to adopt your site for it to grow.

How many mobile browsers have JS enabled or will continue to do so? Ignoring that demographic can also be very perilous to your site's health.

Finally, question those numbers and question them hard. They found that 2% of US users in 2010 who visited Yahoo had JS disabled. What about the people who NEVER visit Yahoo? What security vulnerabilities have been found between now and then? The answer to those two questions can dramatically shift the number of people you're excluding by requiring JS to be enabled.

You need to know who your target audience is and what their behavioral patterns are. Relying on Yahoo statistics for this decision is a bit dodgy.

share|improve this answer
add comment

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.