What to do about JavaScript?


Date: 19 January 2011

JavascriptOne of the most popular current technologies used on websites is AJAX, which stands for Asynchronous JavaScript and XML. JavaScript, which lies at the heart of AJAX, runs in you web browser and has been around for quite a few years. It enables things to happen on otherwise static web pages, independent of the server the website is hosted on.

For example, JavaScript can enable pages to keep reloading themselves automatically, or it can change the content of a page depending on what you enter into a form.

Websites rely on JavaScript

The advantages of JavaScript are so compelling that an increasing number of websites rely on it. In a recent review of online shopping sites conducted internally by SellerDeck (the company I work for), 61% of the online stores examined had checkouts that relied on JavaScript.

The problem is that users can disable JavaScript in their browser setup. And some do.

There are perfectly valid reasons for disabling JavaScript. It can be used by hackers to exploit security loopholes, notably in Internet Explorer (here's an example). It can also be used for intrusive events like pop-up advertising, which many people would prefer to avoid.

How many people disable JavaScript?

Estimates vary for the number of users that disable JavaScript. Until recently the figure generally quoted was around 5%. However, the sites to which I have access are currently seeing around 10-12%, and in one case, 24%. This apparent increase may be partly due to increasing use of mobile devices, which do not generally support JavaScript.

So, if your site uses JavaScript extensively, it is becoming more important, not less, to handle properly the proportion of visitors who have it disabled.

Of the sites we looked at, only around a quarter detected the lack of JavaScript support in visitors’ browsers and presented an explanatory message. The majority, however, did offer the choice of a less functional alternative, with an appropriate warning.

So the lessons are:

  • Don’t completely rely on JavaScript for essential website functions, such as the checkout
  • Detect if a user has JavaScript disabled, and provide a warning
  • Provide alternative mechanisms for essential features, for the benefit of your mobile and security-conscious visitors

Bruce Townsend is the Ecommerce Product Manager at SellerDeck

Practical IT advice for your business

What does the * mean?

If a link has a * this means it is an affiliate link. To find out more, see our FAQs.