JavaScript is as the name suggests a scripting language. It was developed by Netscape to automate and control small code blocks on web sites. 1995 JavaScript was firstly integrated in the Netscape Navigator 2.0. An implementation in Microsoft's Internet Explorer was done later. JavaScript is an extension to HTML and enables enhanced browser control.
In the beginning the script was always a part of the HTML file. Later it became possible to create a separate JavaScript file that was linked to in the HTML document. The programming language itself has a big resemblance to Java. However, far from being comparable to it. Many language elements and ideas from the early days of Java where taken but that's all. In JavaScript it is not possible to define own classes and JavaScipt uses the internal models of the browser itself. This is the reason why there is always a dependency on the browser and without it there is no possibility to execute JavaScript code.
JavaScript offers you as an operator or user of a site many advantages. So it makes the website dynamic and enhances the usability. This can be done automatically or it depends on user actions. Mouse- or keyboard-input can be processed immediately and a response is shown on the screen or the site changes without reloading. Many small tools and games are also available such as calculators, automatically updating rss-readers, clocks, or counters for your visitors.
You can create menus that generate different page content, animated text, change the content or the appearance of multiple frames, control several frames at the same time, or change the view of your website by fitting it to the users screen resolution, time of day or mouse action. The most frequent use of JavaScript is the review and error handling of data input in a form. Before data is sent from a form via e-mail or transmitted for further processing to the server it is possible to check the input for plausibility and to control that the typed e-mail address has the correct format (with a prefix, the @-symbol and the domain-name) and that required fields where not left blank.
All JavaScript programs that are integrated on a site run locally. This results in no further communication between the Web browser and Web server.
If a page is completely downloaded on ones computer you could go offline and the JavaScript programs continue to work as long as the browser window is open and the site is not refreshed by the user.
An important fact: It is not possible for JavaScript to read or even change data on the user's computer. That is benificial for the user but it can be a problem for the programmer. So if there is need of saving data generated by the Script he has to think of alternatives and the combination with other programming languages like PHP.
JavaScript also has only limited possibilities, so complex stand-alone applications are quite difficult to implement.