What does JavaScript

JavaScript: Tasks and areas of application

Here is a JavaScript documentation by molily. At the moment it is still patchy, but it is gradually growing. Comments and feedback are welcome by email.

To the table of contents

What does JavaScript mean?

JavaScript is a programming language that is integrated into websites as an additional technology. The JavaScript programs, also called scripts, are interpreted by the web browser. That is, they are translated into processor instructions and executed. Since JavaScripts are executed on the web surfer's computer, one speaks of a client-side Programming language to differentiate it from programs that run on the web server, such as PHP or Perl scripts.

What does JavaScript do and how does JavaScript work?

JavaScripts have access to the browser window and the HTML document displayed in it. Their most important task is to react to user input in the document (e.g. the user clicks on an element or enters text in a form field). JavaScript can then make changes to the current HTML document. These changes only take place in the browser, more precisely in the main memory of the computer, while the document on the web server remains untouched.

JavaScripts can change both the content and the presentation of the document. In this way a document can interactive and "dynamic«Be designed. This means it can respond to user input and change without having to fetch a new document from the web server. For example, additional information can be displayed as soon as the user clicks on a specific HTML element with the mouse.

The so-called regulates the access to and the modification of the document Document Object Model (DOM) - more on that later. The overwhelming part of JavaScript programming consists of dealing with the DOM. Because of this central importance, »DOM scripting" spoken. An older term is »Dynamic HTML«, Abbreviated as DHTML. This is to make it clear to you that JavaScript is primarily about handling the HTML document in which it is executed.

The importance of JavaScript for the web

JavaScript has become an integral part of today's web and plays an important role alongside HTML and CSS. Almost every website uses smaller or larger JavaScripts.

Many common functions on the web can be simplified and made more user-friendly with JavaScript. JavaScript also enables new functions. However, this does not mean that your website uses JavaScript got toto be complete and successful. A lot of JavaScript doesn't necessarily help much. A careful use of JavaScript ensures, for example, that a website can be used and accessed without JavaScript.

The JavaScript language has existed since 1995 and has been continuously developed. For a long time JavaScript was the "dirty kid" among web technologies and its raison d'etre was questioned. It was not until 2005 that JavaScript experienced a renaissance and the use of JavaScript exploded under the catchphrase Ajax. In addition, theories emerged that justify the sensible use of JavaScript.

JavaScript as a full-fledged programming language

For many web authors, JavaScript is the first programming language they come across. HTML and CSS are also artificial computer languages, but not Programming languages - You cannot use it to write programs that are processed instruction by instruction.

What sounds subtle at first is a big difference: With HTML, you can Mark up texts and build documents. In HTML, so-called elements and their tags are used to structure text. With CSS these Formatted documents and layouted. So-called declarations are written in CSS that address HTML elements and assign formatting to them.

A programming language, on the other hand, works fundamentally different and requires a peculiar approach to problems. The basics of programming cannot be described here, but they are an essential prerequisite for working with JavaScript.

Special features and pitfalls of JavaScript

JavaScript is a construction site: the language started out very small and was not designed to meet the requirements of today's use. Therefore, the JavaScript core and many JavaScript techniques are full of strengths and weaknesses. Some things are understandable and simple, others are confusing and make your work difficult.

Nowadays, large web applications are based on extensive and highly complex JavaScripts. JavaScript is therefore in the interest of computer scientists and software developers who research the language, experiment with it and test its limits. It has only gradually brought good programming techniques to light - and it is an ongoing process that you should follow and be able to participate in.

JavaScript has a special place among the programming languages. If you already know other programming languages, you will surely recognize similarities and be able to reuse your knowledge. But sooner or later you will come across some peculiarities of JavaScript that you will not find in any other programming language on the web. As soon as you start writing more complex scripts, these quirks and the programming techniques that result from them should be familiarized with because you will come to appreciate them.