The rest of this book is in four parts. Part I, immediately
following this chapter, documents the standalone JavaScript
language. This is the core language common to both
client-side and server-side implementations of JavaScript.
Chapters 2 through 5 begin this section with some bland but
necessary reading--these chapters cover the topics necessary
when learning any new programming language.
- Chapter 2, Lexical Structure,
explains the basic lexical structure of the language.
- Chapter 3, Variables and Data Types,
documents the data types supported by JavaScript and also covers the
related topics of literals and identifiers.
- Chapter 4, Expressions and Operators,
explains expressions in JavaScript, and documents
each of the operators supported by JavaScript.
Experienced C, C++, or Java
programmers will be able to skim much of this chapter.
- Chapter 5, Statements,
describes the syntax and usage of each of the JavaScript statements.
Again, experienced C, C++, and Java programmers will be able to skim
some, but not all, of this chapter.
The next four chapters of this first section become more
interesting. They still cover the core of the JavaScript
language, but document parts of the language that will not already
be familiar to you, even if you already know C or Java. These
chapters must be studied carefully if you want to really
understand JavaScript:
- Chapter 6, Functions,
documents how functions are defined, invoked, and manipulated
in JavaScript.
- Chapter 7, Objects,
explains objects, the most important JavaScript data type.
This chapter includes a discussion of creating objects and
defining object methods, among other important topics.
- Chapter 8, Arrays,
describes the creation and use of arrays in JavaScript.
- Chapter 9, Further Topics in JavaScript,
covers advanced topics that were not covered elsewhere. You
can skip this chapter the first time through the book, but the
material it contains is important to understand if you are ever
to become a JavaScript expert.
Part II of the book documents client-side JavaScript. The
chapters in this part document the web browser objects that are at
the heart of client-side JavaScript, and provide detailed examples
of their use. Any interesting JavaScript program running in a web
browser will rely heavily on features specific to the client-side.
You should read chapters 10, 11, and 12 first. After that, you can
read chapters 13 through 20 in any order you choose, although
you'll probably get the most out of this part if you read them in
the order they are presented.
- Chapter 10, Client-Side Program Structure,
explains the various ways in which
JavaScript is integrated into web pages for execution on the
client side. It also discusses the order of execution of
JavaScript programs and the event-driven programming model.
- Chapter 11, Windows and the JavaScript Name
Space, documents the most central and important
object of client-side JavaScript, the Window object. It also
covers issues related to this Window object, such as the
name space, variable lifetime, and garbage collection.
- Chapter 12, Programming with Windows,
discusses and illustrates specific programming techniques
using the Window object.
- Chapter 13, The Navigator, Location, and History
Objects, documents the Navigator, Location, and
History objects and shows examples of using them.
- Chapter 14, Documents and Their Contents,
explains the Document object, which is perhaps the second most
important object in client-side programming. It also
illustrates programming techniques that use this object.
- Chapter 15, Saving State with Cookies,
illustrates the use of "cookies" to save state in web
programming.
- Chapter 16, Special Effects with Images,
explains the Image object and demonstrates some special
graphical effects you can produce with JavaScript.
- Chapter 17, Forms and Form Elements,
documents the Form object, another very crucial object in
client-side JavaScript. It also documents the various form
element objects that appear within HTML forms, and shows
examples of JavaScript programming using forms.
- Chapter 18, Compatibility Techniques,
discusses the important issue of compatibility in JavaScript
programming. It discusses compatibility between Navigator and
Internet Explorer, between different versions of Navigator,
and between JavaScript-enabled browsers and browsers that do
not support the language.
- Chapter 19, LiveConnect: JavaScript and Java,
explains how you can use JavaScript to interact with Java
classes and objects, and even communicate with and control
Java applets. It also explains how you can do the
reverse--invoke JavaScript code from Java applets.
- Chapter 20, JavaScript Security,
provides an overview of
security issues in JavaScript. It explains the steps taken to
plug security holes in Navigator 2.0, and the new "tainting"
security model that is forthcoming in Navigator 4.0.
Part III is the reference section that makes up the second half of
this book. It contains complete documentation for all JavaScript
objects, methods, properties, functions, and event handlers, both
for core and client-side JavaScript.
Finally, Part IV is a section of appendices that you
may find useful. They include lists of commonly encountered bugs,
a list of differences between JavaScript in Navigator and Internet
Explorer, and other helpful information.