开发者

Web Development: Do we still need to support non-javascript users?

Background: I'm working on an e-commerce website. It was my original intention to add JavaScript on top of regular html pages, so that users with JS support got the added benefits, but users without it could still use the basic html forms to add things to their cart, to search, etc.

I've run into a few situations though, where there simply isn't a sane way to implement certain functionality in a non JavaScript way.

One example is chained attribute selects on product pages (where the color choices change based on the size chosen, because not all sizes come in every color). Even if I didn't use AJAX, it would still require JavaScript to dynamically change the options.

The only alternatives to JavaScript that I can think of would be:

A. Have an add to cart "wizard" where you have to step through each attribute choice on a separate page (yuck!)

B. Put each size/color variation out as a separate product (and force the customer to wade through the category page to find the color size combo that they want)

...And while both of the above would work regardless of whether the user has JavaScript on or not, they both punish the JavaScript users by restructuring the page and forcing them to use an interface designed for the lowest common denominator.

So the question is, since JavaScript has taken a much larger role in web development than it did a few years back, and the design pattern for an AJA开发者_Go百科X/JS application/site is so much different now than a 'classic' web design pattern, do we still go out of our way to support non JS users? Or do we say, "To hell with you! Update your browser, turn on JavaScript or go shop elsewhere"?

I'd be interested to see other developer's take on this.


I think it really depends on your target audience. I work for a company that has several types of websites, some are focused on your avg guy or gal who's into gaming. And our stats show us that the vast majority of these people have javascript enabled.

We also have a site that's focused at developers, and many of these developers won't allow javascript to run on a site unless they trust it. I've seen as many as 20-30% of the browsers on that site don't run javascript.

So it's very subjective.

IMHO, it's very reasonable to use vast amounts of tasteful javascript to enhance an otherwise mundane experience. However, I also think that when possible it should gracefully degrade. This form of degradation isn't too hard to achieve (in most cases) as long as you consider it when you're designing things.


The most important non-javascript user is Google. Do not forget that.


When it comes to things like Ajax, or any javascript for that matter, I think it's best to:

Plan for Ajax from the start; Implement Ajax at the end -Jeremy Keith

This means Intercept (hijack) links and forms using (unobtrusive) JavaScript making your code degrade well for those that don't have javascript enabled. If you want to show a fancy slider, make it a link that tells the server to show the div when you reload the page and tell your javascript to do something differently when the link is clicked.

These ideas are your safest bet for a functional, but fun website.


I think that supporting non-Javascript users is absolutely necessary for any site aiming at some kind of "normal" target group (i.e. not gamers or techies).

  • There is an increasing number of mobile devices accessing, and trying to parse, normal content.
  • Many corporate networks still block scripting for security reasons - you don't want to lose the occasional employee shopping from work, either.
  • Javascript tends to screw any attempt at accessibility. In my mind, creating sites that are as accessible as possible is a service to our fellow human beings.

I'm not saying I'm lily white on this. I hate replicating functionality that I just managed to achieve in my JS framework in static HTML, or making it degrade gracefully. But I think it still really, really is a must, and not merely a question of profitability. This is something worth investing a bit extra, or putting a bit of unpaid work into.


If you can exclude users that don't use javascript, so this will be some mobile devices, or the truly paranoid, as well as lynx users, and any users not using the version of javascript you write for.

If you are willing to go with that then I would suggest you have a static html page that has some message that javascript is required.

When your javascript is loaded, and the DOM tree is ready then you can replace this message, so it is never seen, with the rest of the webpage.

But, you may want to see how you can get the functionality, even if limited, for non-javascript browsers.

For example, for colors you can use a horizontal dropdown that can work on all but older IE browsers: http://www.alistapart.com/articles/horizdropdowns/

If you want to use javascript to make your life simpler then that may be a poor reason, but, if you are doing a photoshop webapp then you will need javascript.

NOTE I would suggest having it work with and without javascript, as an e-commerce site will want to not exclude any customers, I expect.


Much of it depends on your audience. As you said years ago JavaScript was used in a different way, and a bit of an annoyance even. Now with AJAX and increased functionality it's a must, and most people have it turned on.

You could say that someone with Javascript disabled is used to stuff not working pretty regularly, and a small minority.

However, if you're building a site that will be frequented by older computers or people on limited bandwidth (such as foreign traffic) you might want to consider working around them. Also a site that is heavily visited by mobile browsers might be another one to focus on.

Take a look at your analytics and see what the current usage is, and profile your audience to really find out.


The best answer will depend on a simple comparison: Estimate the extra money you will spend creating the non javascript alternative site. Estimate the money you will make selling products to your non javascript enabled customers. Compare. If you are a huge shop, then getting sales from that last 2% or 10% of users might be worth it. If you are just one guy, maybe you have more profitable ways to spend your time.


I found this interesting and fact driven post, it might help. Why we should support users without Javascript. Following is a summary:

  1. Some people choose to turn JS off.
  2. JS fails occasionally, HTML/CSS does not.
  3. JS is designed to and should be the icing on the cake, not a patch-job for bad HTML/CSS.


In theory, yes; but in practice, no.

In theory it's in the spirit of the web to support hardware and software with a range of capabilities and configurations, scaling site features appropriately.

In practice, even mobile browsers are converging on the sweet spot occupied by the current major desktop browsers. Users on the outside can typically switch to an alternate browser or device in a pinch.


While it seems logical, progressive, simpler, and more efficient to require Javascript for an e-commerce site, you should ask yourself if you are willing to forego x percent of the business that would be generated by non-Javascript users, and weigh that against lower development costs.

The percent of business lost is likely not the percent of non-Javascript users, because a smaller percentage of non-Javascript visitors are likely to purchase goods are services. The percentage of lost business will probably be somewhat less than the percentage of non-Javascript users.


focus on making advanced feature to the large audience is better than spending time to find work around for non-javascript user and ones who use obsolete platform.


In my opinion there 2 things you have to consider when thinking about using JavaScript on a website:

  • Is Google still able to crawl all the content
  • If some parts of the website are not usable without JavaScript then make a very clear message for the non JavaScript users, why you site is not working for them


I think we need to support non-javascript users again.

There are users including me who doesn't disable JS for any kind of paranoia, but because some sites are so JS heavy nowadays that my browser is slowed down to a grinding halt. And this is getting worse recently, so I expect more users will do this eventually. I wanted my performance back so I installed browser plugins that let me selectively enable only the absolutely necessary scripts on the site. So I can have a dozen of tabs open again without performance problems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜