跳到主要内容

JavaScript Examples Bible: The Essential Companion to JavaScript™ Bible

大小:3MB       时间:2024-12-07

A common thread running throughout most of my computer-book–writing
career is that I tend to write a book I wish I had had in order to learn a new
technology in the first place. Because I must write that book without the benefit of
existing models, I begin by doing my best to master the technology, and then I write
the book to help other newcomers learn as much as I did, but more quickly and
with less pain, anguish, and confusion. To accomplish that goal, I write as much
content as I feel is necessary to cover the topic in the depth that my readers
require.
When I started on what became the 4th and Gold editions of the JavaScript Bible,
there were models to follow (my previous three editions) plus a substantial amount
of brand new material, much of which had not yet been documented anywhere. I
also assumed the responsibility of integrating the frequently conflicting and competing
philosophies of the ways the JavaScript language is applied to a variety of
browser brands and versions. Resolving these conflicts is a challenge that I face in
my own programming work with clients, and I take great pleasure in sharing my
solutions and approaches with other programmers floating in the same boat.
As my editor and I began counting the pages I had assembled for these new editions,
we discovered that the number of pages far outstripped the printer’s binding
capabilities, even in a thicker volume made possible by using a hard cover (the
Gold edition). Certainly not all of the words that I had written were so precious that
some of them couldn’t be cut. But we were hundreds of pages beyond capacity. To
cut that much content would have forced exclusion of coverage of language or document
object model vocabulary.
Fortunately, as had been done in previous editions, the plan for the new editions
included Adobe Acrobat versions of the books on the accompanying CD-ROM.
Although a significant compromise to ease of reading, it was possible to move some
of the book’s content to the CD-ROM and leave the most important parts on the
printed page. For the softcover 4th edition, reference chapters covering less-used or
advanced subjects were pulled from print; for the hardcover Gold edition, which
was longer and targeted more for professional scripters, the advanced chapters
were put back into the book (along with 15 additional chapters for that edition),
and the JavaScript tutorial was exiled to the CD-ROM.
But even after making the difficult decisions about which chapters could go to the
CD-ROMs, the page counts for both volumes were still excessive. Something else—
something big—had to go. The remaining bundle that could free us from the page count devil was all of the Example sections from the reference vocabulary. By being
nondiscriminatory about these extractions—that is, extracting all of them instead
of only selected sections—we could convey to readers a consistent organizational
model.
In the end, the extracted Example sections from Parts III and IV found their way into
Appendix F on the CD-ROMs of both editions of the larger tome. I knew that as a
reader of my own books (and one of a certain age at that) I would not enjoy having
to flip back and forth between book and screen to refresh my memory about a term
and see it in action. A more pleasing solution for many JavaScript Bible readers
would be a separate volume containing a printed version of the Examples sections.
The new volume would act as a companion to both the 4th and Gold editions of the
JavaScript Bible.
Using Appendix F as a starting point, I divided the content into chapters along the
same lines as the JavaScript Bible reference sections. This also gave me a chance to
study the examples for each chapter with fresh eyes. The examples haven’t
changed, but I had the opportunity to direct the reader’s attention to examples that
I thought were particularly helpful in mastering a document-level or core language
object. Thus, each chapter of this book begins with a scene-setting introduction and
a list of highlights to which you should pay special attention. Also, since you will
likely be scanning through the book from time to time, I added many illustrations of
the pages produced from the code listings. These figures will help you visualize what
important listing code does when the page is loaded into a browser.
Now you know the story behind the JavaScript Examples Bible. Some budgetconscious
readers may not be thrilled to pay more for what appears to be a printout
of content they already own in electronic format. If so, then please continue using
the Acrobat version. But if, like me, you enjoy the portability and visual scanability
of a printed work, then keeping this book near your JavaScript Bible volume will
enhance your learning and research activities.