Technology in terms you understand. Sign up for my weekly newsletter, "Confident Computing", for more solutions you can use to make your life easier. Click here.

What is Javascript and why do i need it?

//

I can’t access my HotMail account and it says on my log on page that i need Javascript to go any further. Just what is Javascript and why do i need it?

Well, the short answer is that Javascript is a programming language, and you need it because HotMail says you do.

I know, that’s not very helpful. Let’s see if I can explain in a little more detail.

Become a Patron of Ask Leo! and go ad-free!

Anything that happens on your computer happens because some kind of program tells your computer to do it. In fact, quite often it’s some kind of program telling some other kind of program to do it. It can get quite complicated, as you can imagine.

Take web pages, for example. Each web page is, essentially, a kind of computer program that tells your browser what to do. And, naturally, there are several different types of programming languages that can be used.

In (over) simplified terms:

HTML, or HyperText Markup Language, is the basic language of the web. It describes how a page should look. The browser follows the HTML instructions as it reads and presents the page. Once the page is complete, the browser’s done, and the HTML “program” is over.

DHTML, for Dynamic HTML, adds more programming constructs to HTML to create a way for the DHTML “program” to “do” things dynamically. For example, with DHTML, the web page can specify actions to be taken when certain events happen. A good example is what happens if you move the mouse over this sentence and see its color change from black to red.

Under ConstructionJavascript is not specifically HTML related, but interacts with HTML and DHTML when used in a browser. It’s a more traditional programming language, in that you can write a series of instructions to compute what kinds of actions should be taken based on various conditions, repeat things a variable number of times, and just generally take more complex and sophisticated actions. Small applications and games have been written entirely in Javascript.

The line between DHTML and Javascript can sometimes get blurry, but a rule of thumb I use is simple: DHTML is about the web page, period. The items on a web page, the events that a web page might want to act on (like moving your mouse over text), and the resulting changes to the web page that you might want to have happen resulting from those events (like changing the color of text). Javascript, however, is really web, and HTML, independent. It adds programming things like loops, and variables and functions. You could write a small program to calculate Pi in Javascript, and then perhaps use DHTML to do something interesting on the web page with it.

ActiveX is the next level up. It, too, represents a programming language, but in a different form. An ActiveX control is more like a “.EXE” or “.DLL” file on your computer. Much like that .EXE, it can be written in any programming language, but is “compiled” or transformed into your computer’s “machine” language before it gets distributed for use. ActiveX controls have the most power and speed, and represent the most danger. That’s why you’ll almost always want your browser to ask you before downloading and installing any ActiveX controls.

So in a nutshell, HTML, DHTML and Javascript are all programming languages that are used to make your web pages look and act the way we do.

Now, while HTML and DHTML are fundamental parts of your browser, Javascript, for various reasons can be turned off. But that doesn’t stop some sites from requiring it. HotMail being one big example. They’ve written portions of the HotMail interface using Javascript in order to provide their functionality. So in order to use HotMail, you must have Javascript enabled.

So the bottom line is that you need Javascript … because the websites you’re visiting have chosen to use it.

32 comments on “What is Javascript and why do i need it?”

  1. Worth noting is that one reason Javascript may be turned off is that it is also the language that was used to generate pop-ups and pop-unders. Some pop-up blockers block the actual Javascript event that opens the pop-up window, but others use a brute force approach by turning off Javascript altogether.

    Because Javascript has also been used for other nefarious purposes, like changing your homepage, some browsers block it by default, or require you to proactively approve letting a javascript run when you visit a page.

    Unfortunately, browser makers are still working on ways to allow us to enjoy the benefits of Javascript without being plagued by the annoyances. This is not a failing on their part so much as a problem with how functional Javascript is. The more it can do, the more it can be abused. And when we shut off an avenue for abuse, less ethical webmasters will just try to find new avenues.

  2. I’m on AOL & tried to register a product. I got a pop up that says you must have JAVASCRIPT to be able to do this function.I’ve registered other products & never got a message like that. What should I do ? Download it.

          • You don’t get JavaScript. JavaScript is a language which is incorporated in an html file and is interpreted by your browser.
            If you mean learn to write JavaScript as the previous commenter asked, a great website is W# Schools . They teach not only JavaScript, but pretty much all technical aspects of Web design, and in my opinion, they make it as simple as humanly possible.

  3. I deleted Java because I was told I don’t need it and now I’m told I need Javascript. How do I get it and where do I download it to. Selections are confusing.

    • David: As the old joke goes, “Java is to Javascript as Ham is to Hamster.” Or, in other words, there is no relation between Java and Javascript – two completely different programming environments.

  4. Very informative. I dropped Java from a small laptop simply to save memory space. However, it will be interesting to note when I receive any notice of its need.

  5. Do I need to keep all the previous updates for Java on my computer ? Do the updates over ride previous updates so that I can delete the previous updates which take a lot of MB space on my computer ?

  6. Would Javascript alter my own web pages.
    The colour of the text has changed from black to red,blue and black.
    Also I can no longer alter my web pages.
    Can you Help me with this problem, I don’t know who else to ask.

    Regards Patricia

    • I live in Ireland java script browser to do accounts my son is self employed I do the wages and accounts ROS inland revenue changed their browser to java script in December 2015 all accounts have to be done on it now . Please can you help me download it as I need to get started as soon as possible thanks

  7. Thank you for an informative article.

    I too have been confused about Java and Javascript. My limited understanding is that they are not directly related, although Sun Microsystems are in charge of both. Also, as I understand it, Javascript is incorporated in all reasonably modern browsers and can generally be turned on or off in the Security settings.

    I certainly would like to know more about Java, such as to what extent it is included in browsers, and how necessary is the full download as opposed to, say, the smaller Microsoft Java Virtual Machine, which is still obtainable if no longer supported by MS.

  8. Would you kindly take steps and get this problem sorted out. I like to play Bubbles IQ and Wordz IQ and have been doing so without any problem for several months now all of a sudden I find that I need Javascript enabling. How come this has not been an issue until now? I want to play these two games again so can you please let me know how to enable Javascript because as far as I know, I did not have it before. HELP NEEDED NOW! I see that I am not the only person affected and I suspect that they are all as angry and disappointed as I am. Let us know how to get our favourite games back again.

  9. can u please tell me about javascript. where we have to used in our web pages???/ i am new developer and i ma getting confuse where i have to use

  10. I have been using the “gift” of social networking for 6 or 7 yrs. now. My favorite has been Facebook, but just recently, they informed me that I need Javascript in order to use their website. None of my friends who do not have Javascript have been told this, so I wonder why they have insisted that I get it? My Mac is less than 9 months old, so ancient equipment can’t be the reason. Have you a clue to this dilemma? thanks. Rosemary Hepler; email: {removed}@outlook.com

    • Javascript capability is enabled in every web browser. It is enabled by default. That’s why it appears that your friends don’t have it. Apparently, you or someone else disabled Javascript on your browser. You would go into your browser settings to enable it. Since you don’t mention which browser you are using, I suggest you search for ‘enable javascript [browser name]’ without the quotation marks to get instructions.

  11. I wrote the comment I believe you are referring to-requiring my name and email address. It must’ve been because it’s normally late for mr to be up. Anyhow, I see that I may choose not to have my last name published-I prefer not to have a bored teenager calling me.lol. Anyhow, my question had to do with Facebook requiring that I need to get Javascript in order to use Facebook after all these years. Thanks, Leo

  12. Thank you Leo.
    You answered all my questions, just by me taking the time reading all the questions & answers from your past post.
    Have a womderful day…

  13. JavaScript is a client scripting language which is used for creating web pages. It is a standalone language developed in Netscape. It is used when a webpage is to be made dynamic and add special effects on pages like rollover, roll out and many types of graphics.

    You can learn it from websites like : W3Schools, JavaTpoint, and {link removed}

Leave a reply:

Before commenting please:

  • Read the article.
  • Comment on the article.
  • No personal information.
  • No spam.

Comments violating those rules will be removed. Comments that don't add value will be removed, including off-topic or content-free comments, or comments that look even a little bit like spam. All comments containing links and certain keywords will be moderated before publication.

I want comments to be valuable for everyone, including those who come later and take the time to read.