J
JScripture

Why JavaScript was created

A simple, easy explanation of why JavaScript was made, with old vs new comparisons.

Old websites were slow

Long ago, a webpage had no brain of its own. It could not check anything by itself.

So when you filled a form, the page had only one option: send everything to a server, a powerful computer sitting far away that stored the website and did all the thinking for it.

Why send it there? Because the checking rules, like "did you fill your email?", lived only on that server, not in your browser. The page in front of you was just plain text and boxes. It had no rules of its own.

What happened, step by step:

  1. You fill the form and click submit.
  2. Your browser sends it all to the server.
  3. The server checks it and finds the mistake.
  4. The server builds a new page showing the error.
  5. Your browser loads that new page.

Even one missing letter forced this full trip, every single time. There was no shortcut.

It got worse from there. The new page did not always remember what you had already typed. Careful websites tried to fill your old answers back in, but many simple ones did not. So along with the wait, you could lose everything and have to start over, all because of one small mistake.

Compare that to today: Now, a red message like "Email is required" appears the moment you leave a box empty. No waiting, no server trip, nothing lost. The page checks it right there, instantly, because JavaScript lets it carry its own small rules now.

The browser could only show, not think

A browser is the app you use to open websites, like Chrome.

Long ago, its only job was to display whatever page arrived. It could not react to a click or a keystroke on its own, it could only ask the server "what happens now?" and wait for an answer.

Think of an old TV. It shows you a channel, but you cannot ask it anything back. It only displays.

Compare that to now: Click "Add to cart" today, and the item appears instantly. The browser did that itself, no need to ask a far away server just to show one small update.

A company needed a fast fix

In 1995, a company called Netscape made a popular browser. Microsoft was building browsers too, and Netscape wanted theirs to feel faster and smarter.

They wanted the page itself to check small things instantly, instead of always asking the server.

Made in just 10 days

Netscape asked one person, Brendan Eich, to build this. He made the first version in about 10 days, in May 1995.

With so little time, some parts came out a bit messy, and a few odd rules from that rush still exist in JavaScript today.

The language changed names twice before settling: first Mocha, then LiveScript, then finally JavaScript.

The real problem it solved, in one line

Old pages could not react to you at all. Every small check meant a full trip to a far away server, and sometimes losing your work along the way.

JavaScript gave the page a small brain of its own, so it could react to you instantly, right there, without needing that far away computer for every little thing.

Why this still matters today

JavaScript was built for small, quick jobs inside a browser, not big heavy tasks. That is why, even today, it usually handles one thing at a time, step by step, instead of many big things at once.

Knowing this simple starting problem makes it much easier to understand why JavaScript behaves the way it does today.

Related articles

More related articles coming soon.