[go: up one dir, main page]

What is JavaScript?

Updated at: Jun 25, 2024

JavaScript is a programming language that web developers (the people who make websites) can use to add a bit of "interactivity" to a webpage.

Websites without JavaScript...

Without JavaScript, a webpage is just a collection of words and pictures. You're able to click a link to another page or submit a form, but that's about it. There's nothing interactive on it and nothing responds to what you do on the page, it's almost like an electronic piece of paper. Traditionally for anything to happen on the website like that, you would have to click a button to submit a form or click a link and then your browser would reload the whole page, or show you a new page.

Websites with JavaScript!

When a web developer starts to utilize JavaScript on their pages, they suddenly get to "make it do things" while you're still looking at it - no need to reload the page. And this can make a website a lot more useful.

If it's a News website, visitors no longer need to keep refreshing it to see the latest headlines, because by using JavaScript the page can update itself every few seconds. If it's a chat website then new messages will automatically appear thanks to a bit of JavaScript code. And if it's a game website then things can be clicked on, dragged, and interacted with, making the game more fun and engaging while still be run from just a website. If you have JavaScript disabled, you won't get those extra features.

Websites built entirely with JavaScript

In the past (in the 1990s, and 2000s), JavaScript was used sparingly on websites; to simply add an "extra layer" of functionality that wasn't possible on a plain, static page. The general idea was that you could still use the site without enabling JavaScript, it just won't work as well.

However, in the last decade or so, a lot of web developers have gone to the extreme with building websites in JavaScript; and now some sites are built entirely in JavaScript, and as a result they won't work at all unless you have JavaScript enabled.