JavaScript is a prototype-based language designed by Brendan Eich. Its most prominant use is as a client-side scripting language for web pages, but it is not confined to this role. A common example of server-side use is for implementing the back-end component of Ajax applications, which has the benefit that the whole of the application can be implemented in a single language.

The language has been standardised as ISO/IEC-16262 and ECMA-262, but under the name ECMAScript rather than JavaScript for commercial reasons. As of HTML5 it is expected to become the default scripting language for HTML (though it is already well-established as the de facto standard). The W3C Document Object Model (DOM) provides JavaScript bindings to facilitate the manipulation of XML and HTML documents.

JavaScript is incorporated into an HTML page using the script element. This either contains the script as its content, or if the script is external, has a src attribute containing the URI at which it is located. Fragments of JavaScript can be included in event attributes such as onload and onclick.

Stand-alone JavaScript programs can be executed using an interpreter such as Rhino. Another method of execution is to use an embedded interpreter, such as the javax.script package which embeds JavaScript into Java. Notable libraries include jQuery (for client-side scripting) and Node.js (a server-side framework).


Further reading