JavaScript is object-oriented multiplatform scripted language.

  • Object-oriented: Code consists of classes, to which are then added methods and from the resulting classes are created objects.
  • Multiplatform: JavaScript functions on different operating systems. It can be used in Windows, MacOS X or in Linux.
  • Scripted: In JavaScript are not created programs, but scripts. It is not necessary to translate them from machine code and it is possible to use them immediately.

The author of JavaScript is Brendan Eich, who was working in Netscape company in that time. It is often mistaken for the JAVA, but the programming languages are completely independent and different. The word JAVA is part of the name of this language wholly for marketing reasons. In July 1997 was JavaScript standardized by international association called European Computer Manufacturers Association (ECMA) and later on in August 1998 by International Organization for Standardization (ISO). Standardized version is called ECMAScript.

The basic syntax is as similar to languages like C++ or Java as to reduce number of new concepts, which are needed for learning the language. Therefore, the common condition constructions of “if” type, “while” cycles, “switch” or e. g. “try… catch" function the same or very similarly.

Together with HTML and CSS belongs among three essential web technologies. It is used in front end on websites, where it is often inserted right to the HTML code. It is used typically for the control of different website interactive elements, such as buttons or text field, with its help are created animations and picture effects.

It can be said, that JavaScript supports all browsers. It is important to take into account, that some elements are supported by different browsers differently, thats why it can be required to use modified procedure.

Scripts can be inserted directly to the HTML code or to save them to separate file, to which HTML code links.

Why JavaScript?

JavaScript is one of the three languages, which must the website developer handle. He needs HTML to define content of websites, CSS, to specify their layout and styles, and JavaScript to program active elements of a page. Except for the simplest pages, on which is only text and few links, we can find JavaScript practically on every website. Usually, it handles the user forms, buttons and other active elements. In May 2017, 94,5% out of the 10 million most popular websites in the world, were using JavaScript.

It allows:

  • Upload new website content or insert data on server without the reloading of website (e. g. when using social networking sites, it can allow the user to share status without having to leave the page)
  • Animate the elements of the page so they would float and disappear, change size or move
  • Insert interactive content, e. g. games, turning on the sound or video
  • Validate the input of form values so the acceptability would be verified before saving on server
  • Information transfer about user habits and activity on different websites, which is used for web analysis, evaluation of the campaign effectiveness, personalization and other purposes

Because JavaScript runs directly in browser and not on a distant server, it can respond to user’s actions very quickly, by which are the websites with its use more responsive.