Introduction


Back in 1999, I wrote a book on JavaScript. At the beginning, it sold really great, and then sales started to decrease a little bit. It still sold well enough to reach seven editions by this fall, but there was a subtle decline in copies nevertheless.

However, all of this changed drastically at the end of last yearsales went up considerably, as did sales of other titles in the same segment. But how come? One of the reasons is AJAX. The technology itself is not new, but the term is. In February 2005, Jesse James Garrett coined the acronym, and since then, the whole web world seems to have gone crazy. And although AJAX can be explained in a couple of minutes actually, it requires a good knowledge of various aspects of JavaScript. This explains the growing demand for advanced JavaScript content, and also led to the writing of the JavaScript Phrasebook.

When we (Damon Jordan, Mark Taber, and I) created the book series in 2005, we wanted to create a kind of pimped-up version of language phrasebooks: Common sentences and expressions are translated into a foreign languageinto JavaScript, of course. However, unlike in a regular phrasebook, you will also get explanations alongside the code. Without it, the potential for embarrassing situations is quite high, in any language.

This book is no introduction to JavaScript. Elementary JavaScript features are covered, but we tried to put a great emphasis on intermediary and advanced material as well. The idea behind this phrasebook is that especially if your JavaScript knowledge is rusty, you will find common problems and solutions in this book. So use this book as a reference guide to quickly overcome issues you are facing during development. And explore the book to find some JavaScript features you may not have thought about before.

This book is no cookbook with long and inflexible solutions to short problems. The idea was to keep the code snippets as concise as possible so that the approach can be demonstrated; this enables you to adapt the presented technique to your own applications and your specific scenario. In order to make this possible, only the code elements that are vital for the samples to run are shown in this book. Usually, the code consists only of <script> elements and some other HTML tags to tie everything together. A modern web application should at least try to be XHTML-compliant, but this is not the focus of the elements of this book.

We took great care to make the code work on as many browsers as possible. And while Internet Explorer and the various Mozilla flavors (including Firefox) dominate the market, Opera, Safari, and Konqueror also have their share in it. So while the focus of the phrases lies on the first two browser types, incompatibilities or caveats regarding the smaller browsers are noted where appropriate. Speaking of market shares: Only browsers that are still relevant as of today are covered; therefore, Netscape 4 and Internet Explorer 4 are not mentioned at all.

Code samples to this title and updates can be found at http://javascript.phrasebook.org/. Most listings have the associated filename with them, so you can easily find the right file(s) for each phrase. If you have any feedback or have found an error, please let me know! If a phrase you were hoping to find is missing, please let me know. If you think that it should appear in upcoming editions of the book, I'd also appreciate if you'd nominate another phrase that you feel is superfluous. (These books are small, and there's only so much space.) The list of potential phrases was much longer than what you are holding in your hands now, so we went through a painful process of eliminating contentand hope that the selection is to your liking.

Finally, thank you to a bunch of people who helped make this phrasebook more useful than the famous dictionary in the Monty Python sketch that mapped innocent expressions to vulgar translations: Shelley Johnston set this project up and convinced me to do the original phrasebook (PHP Phrasebook). Damon Jordan also worked on the PHP Phrasebook and served as the editor for this title. Phil Ballard tech-edited this book. Thanks for all your hard work on this!

Also, thanks to Judith Stevens-Lemoine, who has been editing "my other" JavaScript book since 1999. I'd like to thank her for giving me permission to write this phrasebook. Looking forward to the eighth edition!

Your personal phrasemonger,

Christian Wenz




JavaScript Phrasebook(c) Essential Code and Commands
JavaScript Phrasebook
ISBN: 0672328801
EAN: 2147483647
Year: 2006
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net