Overview
JavaScript is a powerful scripting language that can be embedded directly in HTML. It allows you to create dynamic, interactive Web-based applications that run completely within a Web browser; you don't have to do any server-side programming, like writing CGI scripts.
JavaScript is a simpler language than Java. It can be embedded directly in Web pages without compilation, so it is more flexible and easier to use for simple tasks like animation. However, although you can write reasonably robust and complete Web applications using JavaScript alone, JavaScript is not a substitute for Java. In fact, JavaScript is a good client-side complement to Java; using the two together allows you to create more complex applications than are possible with JavaScript alone.
JavaScript: The Definitive Guide provides a thorough description of the core JavaScript language and its client-side framework, complete with sophisticated examples that show you how to handle common tasks, like validating form data and working with cookies. The book also contains a definitive, in-depth reference section that covers every core and client-side JavaScript function, object, method, property, constructor, and event handler. This book is an indispensable reference for all JavaScript programmers, regardless of experience level.
This third edition of JavaScript: The Definitive Guide describes the latest version of the language, JavaScript 1.2, as supported by Netscape Navigator 4 and Internet Explorer 4. The book also covers JavaScript 1.1, which is the first industry-standard version known as ECMAScript. The new features of JavaScript 1.2, which are likely to be embodied in a later ECMAScript standard release, are clearly indicated, so that you can use them as appropriate in your scripts.
Geared toward JavaScript programmers, this book provides an excellent programmer's guide and reference manual for JavaScript 1.2. It includes a thorough description of the core JavaScript language and a detailed reference section.
Editorials
From Barnes & Noble
The Barnes & Noble ReviewOver the past few years, the JavaScript language has matured. Not only is JavaScript now an international standard (called ECMAScript), the standard itself is in its third, refined version. Conformant implementations are available in several leading browsers, from Microsoft Internet Explorer 6 to Mozilla; and open source versions are available to be incorporated into any application that can benefit from a scripting language.
All this is to say that JavaScript is more useful than ever, and the JavaScript you use now can be relied upon (at least as much as anything in the computer industry Well-known as "The Rhino Book" for its cover, JavaScript: The Definitive Guide has long been an outstanding resource for JavaScript programmers. Flanagan writes with discipline and clarity, and his book combines excellent tutorial coverage with a detailed reference that documents the classes, methods, and properties defined by the core JavaScript language.
But a lot's changed since the 1998 edition. And if you got involved with JavaScript at the heat of the web gold rush, a lot's changed since whatever JavaScript book you rely on was written. Here's just some of what's new and different in this book.
First of all, Flanagan's thoroughly updated his coverage to reflect JavaScript 1.5 and the aforementioned ECMA-262 third edition standard. Previous editions had a heavy focus on Netscape's implementation of JavaScript; that will obviously no longer do, so Flanagan has moved to a focus on the official standard. Since browser conformance has improved significantly, this book will help you write code that'll survive pretty much any browser you throw at it. (The reference section carefully specifies when each language element was introduced, and which versions of the standard support it.)
Flanagan's reorganized the book. For one thing, core language coverage has been separated with coverage of using JavaScript in client-side browsers, recognizing that many JavaScript developers nowadays aren't working in classic web browser environments. More important, he's moved the coverage of the W3C's DOM implementation into a section of its own, and substantially expanded that coverage. (Both DOM Level 2 and Level 1 are covered, with Level 0 coverage kept for backward compatibility.)
JavaScript: The Definitive Guide, Fourth Edition begins with an overview of what JavaScript can and cannot do, including some lingering myths about the language (many still view it as purely a simple scripting language, and are surprised by its depth when they attempt to perform complex tasks with it.) Next, Flanagan reviews the fundamentals of JavaScript 1.5: its lexical structure, data types and values, variables, expressions, operators, and statements.
If you're an experienced Java, C++, or C programmer, much of Section I will be familiar: JavaScript was designed to help developers leverage existing skills. Section II, however, focuses on stuff that's handled significantly differently in JavaScript. Here, Flanagan covers functions, objects, arrays, and pattern matching with regular expressions. He also introduces several advanced features, notably JavaScript's automatic data type conversion, garbage collection, lexical scoping, and function constructors.
Next, Flanagan focuses on client-side JavaScript. He shows how JavaScript integrates with web browsers; introduces the Window object and JavaScript's event-driven programming model; and shows how to use the Document Object to expose an HTML document's contents to JavaScript code. The book includes chapters on forms and form elements; cookies; and scripting CSS/DHTML to manipulate the style, appearance, and position of HTML document elements.
Notwithstanding Microsoft's dominance, it's still a diverse world out there. Flanagan shows how to avoid, minimize, and mitigate browser incompatibilities, introducing techniques for testing features, implementing platform-specific workarounds, and testing compatibility with server-side scripts. There's coverage of security, and a quick look at using Java with JavaScript. And the 300-page reference? Invaluable.
You'll live happily with this book for a long time.
(Bill Camarda) Bill Camarda is a consultant, writer, and web/multimedia content developer with nearly 20 years' experience in helping technology companies deploy and market advanced software, computing, and networking products and services. He served for nearly ten years as vice president of a New Jerseybased marketing company, where he supervised a wide range of graphics and web design projects. His 15 books include Special Edition Using Word 2000 and Upgrading & Fixing Networks For Dummies®, Second Edition.