Chapter 11. JavaScript

JavaScript is a lightweight, object-based scripting language. The general-purpose core of the language has been embedded in Netscape Navigator, Microsoft Internet Explorer, and other web browsers and embellished for web programming with the addition of objects that represent the web browser window and its contents. This client-side version of JavaScript allows executable content to be included in web pages. With JavaScript, you can move beyond static HTML to write web pages that include programs that interact with the user, control the browser, and dynamically create HTML content. JavaScript is the most popular scripting language for client-side web development.

This chapter starts with coverage of the core JavaScript language, followed by material on client-side JavaScript, as used in web browsers. The final portion of this chapter is a quick-reference for the core and client-side JavaScript APIs. For complete coverage of JavaScript, we recommend JavaScript: The Definitive Guide, by David Flanagan (O’Reilly).

Versions of JavaScript

The name JavaScript is owned by Netscape. Microsoft’s implementation of the language is officially known as JScript, but very few people actually make a distinction between JavaScript and JScript. Versions of JScript are more or less compatible with the equivalent versions of JavaScript, although JScript skipped a version and went directly from JavaScript 1.0 compatibility to JavaScript 1.2 compatibility.

JavaScript has been ...

Get Webmaster in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.