Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript over/under usage. what is acceptable these days?

As a budding web developer I'm trying to walk the fine line of cross-platform usability/compatibility and pizazz(functionality).

Is this as much of a problem as it was a few years ago? The parts of my site that - dare I say - require (aka make my life easier) JavaScript would not be something that a mobile would want to access (although it could if it wanted to).

http://www.w3schools.com/browsers/browsers_stats.asp

If you scroll down, it seems to indicate that 95% of computers accessing that site have JavaScript enabled/installed.

Any input from someone who has dealt with this issue would be appreciated.

like image 922
lewicki Avatar asked Oct 13 '22 22:10

lewicki


2 Answers

I don't know anyone these days who has Javascript turned off permanently. The sheer amount of sites that rely on JS means that the web is virtually unusable without it.

The vast majority of people simply leave it on all the time. Most of the really serious security holes that used to make people turn it off have long since been fixed, so it's much less of an issue than it used to be.

There are still some things that worry the paranoid, but even then most people who do disable JS do so on a site-by-site basis using a tool like the Firefox NoScript extension rather than just switching it off. When these people visit a new site, they have to decide whether they trust it enough to enable JS for it.

The other demographic which may be affected is disabled users, using a screen reader or other assistive technology. Many of these people may not be able to use Javascript. (that said though, many of them can; screen readers are not nearly as backward compared with regular browsers as many people imagine)

As the end of the day though, it's up to you really to decide what to do about supporting your visitors who don't have JS. Here are some things to consider:

  • Does your site absolutely require Javacript - If you're writing a GMail type system, and the whole thing only works because of JS, then obviously you can't support not having it.
  • How much of your audience will have JS disabled? How many of them will be prepared to re-enable it just to visit your site? How many of those people are you prepared to lose? You'll need to know your own demographic before you can answer that.
  • Can you write the JS features such that the site still works sufficiently without them? Users with JS turned off will expect sites they visit not to look great and having missing functionality, but they'll be happy as long as the important bits still work for them.
like image 190
Spudley Avatar answered Oct 16 '22 15:10

Spudley


It depends on what you're doing. I'm a firm believer in Javascript gracefully degrading if it's just adding UI sugar. It's a fine line though, and there's not really one answer. Sometimes you'll be able to make assumptions about about your userbase -- for example, if you're writing a mobile web application, you're pretty much guaranteed good HTML5 support. Other times, you might need to worry about having rock-solid IE6 support. It all comes down to what your audience is and how much time you can afford to spend supporting different configurations.

I would highly recommend that you, as a budding web developer, learn how to do progressive enhancement with your Javascript. It's often the "right" way to approach a problem, even if you don't care about supporting javascript-less browsers; and it's very likely that you'll run into a situation in the future where you've got to support backwards browsers (which is a group you can lump Googlebot into as well).

like image 20
ShZ Avatar answered Oct 16 '22 14:10

ShZ