Learn about JavaScript

In other parts of whatismybrowser.com, we make reference to JavaScript and in our efforts to keep everything concise and straight-forward we can't always give really detailed explanations on those pages - it would just complicate things and we'd be repeating ourselves in multiple places!

So, we decided to make a page for absolute beginners to learn the basics about JavaScript - we'll explain in a bit more detail and hopefully make it clear enough so that everyone can get the idea!

We've done some other topics as well, so be sure to check out our other Learning Guides.

What Is JavaScript?

JavaScript is a programming language which runs inside your browser and which adds extra functionality or features to the website you're visiting.

When you visit a web page, your web browser will typically download:

  • the HTML for the website (this controls the text on the page as well as what "parts" of the page there are)
  • the styles for the website (these control how the parts of the website look - eg. the colors and the sizes)
  • the images (and maybe videos) for the web page
  • and it also typically downloads the JavaScript for the page.

The JavaScript that gets downloaded is written by whomever made the website (unless they're reusing someone else's JavaScript code), and it lets the developer add some extra functionality to the site.

By default, the HTML and the styles of the website are all "static" - they don't change or do anything by themselves. However with JavaScript, the website you're using can then do extra things - you might click a button and a hidden part of the page appears or maybe there's controls to start or stop a video. If there's a game on the page, then it's probably written in JavaScript to make all the different parts of the game work.

JavaScript can also run "by itself" - eg there might be a chat window in the corner of the page which is just constantly running and updating itself with what other people are typing without you needing to click anything.

JavaScript is used to do all of that.

How do I install JavaScript?

You don't need to! Every web browser since the mid 1990's has JavaScript built into it. It may be disabled in your browser, but it's there! If you need to; read our guide: how to enable JavaScript.

Do I need JavaScript enabled?

Most websites these days require JavaScript to provide the more advanced features people are used to these days. Nearly every website these days seems to have some kind of menu that expands, an annoying video that auto-plays, a never-ending list of posts or images to scroll through, a loading screen, a pop-over window for a newsletter, a help-chat window that slides up, something that automatically loads more articles and other distracting "features"... Some websites are so dependant on JavaScript that they won't even load without it enabled.

In the very early days of the World Wide Web (what most people just call "the Internet" these days...), JavaScript didn't even exist thus wasn't required at all!

JavaScript was developed in 1995 by a software developer named Brendan Eich as a way of adding some basic interactivity to otherwise static pages. It was still usually quite optional to use (and some browsers didn't even support it!)

However now, JavaScript is a major element of the modern web and it seems like most websites won't work with out it.

It might seem like you should just always keep JavaScript enabled - I mean, why would anyone disable it if it's that important, right?

Some problems with JavaScript

There's nothing wrong with JavaScript per se, the problem is that it can also be used in many different ways by unscrupulous companies to track your activity online. The increasing loss of privacy at the hands of huge corporations is a growing problem and many people are rightly concerned about it.

Websites are desperate to get your attention, and often JavaScript is used to animate parts of the page to get you to take a certain action (subscribe, sign up, share). Disabling JavaScript (or using an Add-on to selectively disable it) can alleviate some of these problems.)

Another problem is that some websites use ridiculous amounts of JavaScript code to work, which results in large download sizes to make websites work, and that's:

  1. Annoying
  2. Slow on bad internet connections
  3. Expensive if data transfer costs you a lot of money in your country

Later in this Learning Guide, we'll address more of the privacy concerns and annoyances, and show you some ways to mitigate some of these problems.

More coming soon

Get a VPN to help stay safe online