JavaScript is the most used programming language for browser side scripting,
and as Dynamic HTML becomes more important the language, as the engine which
drives DHTML, is becoming even more important. There are tons of books on
JavaScript programming, but most tend to focus on the non-programmer, the
HTML hacker who needs bits of code they can cut and paste and tweak a bit
to integrate into their web pages. But somebody needs to supply scriptlets
to the HTML hackers, and doing that well requires in-depth knowledge of
JavaScript. JavaScript, the Definitive Guide teaches JavaScript not as an
extension to HTML pages, but as a full-fledged programming language.
January 10, 1999
I learned JavaScript from the second edition of this book, and keep it
within easy reach of my desk as a reference, so I was pleased to find
a new edition. This edition keeps the same structure and approach, but
updates the book for JavaScript 1.2 and the version 4 browsers. There
isn't a wealth of new material, but if you depend on this book as I do
you'll want the new edition for the updated reference section, and may
find some new tidbits in other parts of the book such as the chapter on
DHTML. For those new to the book, whether this is the right book for
you depends a lot on what approach you want to take to learning, or
improving your knowledge of, JavaScript.
The first of the book's three sections explains JavaScript as a programming
language independent of it's use as a browser scripting language or any
other purpose. Flanagan doesn't hold the reader's hand, or rush you into
copying code to make things jump around a web page at your first sitting
with the book: you must first learn the fundamentals of the JavaScript
language. The structure of the language, data types, expressions, control
flow, and objects are all explained thoroughly.
This approach makes this book excellent for programmers who want a
thorough and powerful understanding of JavaScript than people who are
intimidated by "real" programming and are looking for code they can easily
copy into their HTML pages. I'm not sure whether this section would be
great for someone who wants to learn JavaScript as a first
language - it doesn't really cover programming fundamentals. The section
seems mostly intended for programmers, especially those who
know C and/or C++, to add JavaScript as a second or later language.
Once you understand JavaScript as a language, independent of the
environment it runs in, you're ready for the second section, which
teaches you how to write programs to run in web browsers. Topics
covered include the Document Object Model (DOM) which makes
components of web pages and browsers available to JavaScript
code for manipulation, the event model which determines when
JavaScript code is executed, and the security system which limits
what your scripts can do to protect users. Again, the approach
is thorough.
The third section is the most useful for those who already know
JavaScript, as it provides a detailed reference of all of the
objects, methods, and properties available to web page programmers.
Entries describe the usage of each item and indicates which
versions of JavaScript support the feature described, which is
of crucial importance.
My only gripe with this book is that it ignores server side programming.
Netscape and Microsoft both include server-side JavaScript interpreters
with their web servers as an alternative or complement to CGI
(LiveWire/SSJS and ASP, respectively). Both add new objects to those
available when programming in browsers, such as File and User.
Including a chapter on server-side JavaScript, and references for
objects used in IIS and Enterprise Server would make the book that
much more useful to those of us who try to leverage our JavaScript
skills on both sides of the connection.
But this book stands out in the field of JavaScript books for its
disciplined, thorough approach to the JavaScript language. While
it would most likely disappoint a non-programmer who simply wants
to dabble in JavaScript, for those who want to go beyond copying
code to create their own applications, it's hard to beat O'Reilly
Publishing's Definitive Guide.