What is JavaScript

Question: What is JavaScript?

Answer: JavaScript is a scripting language designed for adding interactivity to HTML pages. The language was first implemented by Netscape Communications in Netscape Navigator 2 beta (1995). JavaScript is different from the Java language (developed at Sun Microsystems). However, the two languages can interoperate well.

JavaScript programs, or scripts, are usually embedded directly in HTML files. The script executes when the user's browser opens the HTML file. (There is also server-side JavaScript, but it's beyond the scope of this FAQ collection.)

JavaScript is an interpreted language. This means that scripts execute without preliminary compilation, i.e. without conversion of the script text into a system-dependent machine code. The user's browser interprets the script, that is, analyzes and immediately executes it. JavaScript is supported by the following browsers:

  • Netscape Navigator (beginning with version 2.0)
  • Microsoft Internet Explorer (beginning with version 3.0)
  • Any other browser/product whose vendor licensed or implemented JavaScript interpreter (for example, Opera).
Thus, most Internet users today have browsers that support JavaScript. That's why JavaScript is one of the most popular tools for adding interactive features to Web pages.