JavaScript

Purpose

JavaScript is an interpreted semi-object-oriented programming language that is designed for creating dynamic web content. It is mainly used for client-side scripting, where JavaScript code included in a web page is executed by the browser to generate content. JavaScript, with the help of CSS, can also style the content.

The JavaScript syntax is designed to make web programming accessible to web designers that are not experienced software developers. Thus its object-oriented aspects are weakly developed.

Modern JavaScript interpreters include support for DOM (Document Object Model). DOM support gives JavaScript programmers the capability of adding content to their web pages. Looping constructs in the language allow programmers to generate complex web pages with very little effort.

History

JavaScript was developed by Netscape in 1995 for use in their browsers, primarily for controlling applets. However, it rapid gained popularity for manipulating web content other than applets.

Microsoft soon developed a competitor to JavaScript: JScript. JScript was similar to JavaScript, but there were som differences in the languages and significant differences in the object model. The competition resulted in extreme difficulties getting scripted web pages to work on different browsers.

More recently, the language has been standardized under a new name: ECMAScript, but most people still call it JavaScript. More recent browsers have supported this standard. The document object model, however was not supported the same way in different browsers. DOM standards do specify JavaScript bindings, but Microsoft's Internet Explorer has lagged in support for these standards. Microsoft has announced its intention to fully support the standards in its upcoming IE 8 version.

JavaScript Syntax

JavaScript's syntax for control structures is almost identical to C, C++, and Java. However, its variables are not typed and its object model is much weaker than C++ and Java. For a quick overview of similarities between JavaScript and Java see JavaScript for Java Programmers.

JavaScript Examples

Online References

  1. ECMAScript (www.ecmascript.com)
  2. JavaScript: How Did We Get Here? (O'Reilly)
  3. JavaScript (Mozilla)
  4. JavaScript Tutorial (www.w3schools.com)