24 Jun The Use of JavaScript in Web Design

JavaScript is a programming language which is dynamic, untyped, interpreted and high-level.  HTML, CSS and JavaScript are the three core technologies of content production on the World Wide Web.

It is most commonly used as a client scripting language with the main purpose of improving a visitor’s experience of a web page by converting it from a static page into one that they can interact with.

JavaScript has become so ubiquitous on the internet that it is now supported by all modern Web browsers without plug-ins. The majority of websites are designed and developed to utilise some JavaScript. One reason for this is that JavaScript is so easy to learn and use. Another reason has to do with the wide availability of easy-to-incorporate, open-source libraries like jQuery, React.js, Backbone.js etc.

However, web developers should be judicious with the use of JavaScript as there are plenty of reasons why overusing JavaScript can hurt your site. These include:

  • JavaScript is a bit like images. Too many scripts and the page is overloaded and takes too long to load on many systems. Google will punish a website for poor load speeds and of course users won’t stick around if a site is slow to load.
  • Mobile browsing can be adversely affected. JavaScript doesn’t always render well on mobile devices, which can clog up the load speed of your page. This is particularly relevant in the wake of Google’s Mobile Friendly update.
  • Using more than one JavaScript on a page can, for various reasons, cause conflicts so that one or both scripts may not work. These conflicts can almost always be worked out but, this can sometimes be a time consuming task.
  • JavaScript, like many web languages/scripts, can be exploited if it’s improperly implemented. This is often because it calls to other sites in order to make it work properly (think social plugins). Malicious code injections can also be carried out, usually in order to steal information. To protect against this you should always validate all user inputs – they should be treated as untrusted data.
  • JavaScript isn’t crawled by search engines so if your site uses a lot of JavaScript then this may affect your SEO ranking.

There’s nothing wrong with using JavaScript in general. It has a lot of great benefits and allows web designers to come up with interesting designs. However, we recommend you limit the amount of JavaScript you use so that it doesn’t make your site painful for users, across all devices.

Prudent web design can, and should, provide fall-backs for non-JavaScript enabled browsers.