There are two types of readers of this book. The first is someone who reads it cover to cover, picking up tidbits of applicable knowledge along the way. The second is someone who dips their toes in as needed, seeking out the solution to a specific challenge or category of problem that they face. We attempted to organize the book in such a way that it would be useful to both types of readers, organizing it into three sections:
Each chapter of the book is broken down into several individual recipes. A recipe is composed of several parts:
This defines a common development scenario where JavaScript may be used.
A solution to the problem, with a code sample and minimal description.
An in-depth discussion of the code sample and techniques.
Additionally, a recipe may contain recommendations for further reading in a See Also section, or additional techniques in an Extra section.
Conventions Used in This Book
The following typographical conventions are used in this book:
ItalicIndicates new terms, URLs, email addresses, filenames, and file extensions.
BoldIndicates UI items such as menu items and buttons to be selected or clicked.
Constant width
Indicates computer code in a broad sense, including commands, arrays, elements, statements, options, switches, variables, attributes, keys, functions, types, classes, namespaces, methods, modules, properties, parameters, values, objects, events, event handlers, XML tags, HTML tags, macros, the contents of files, and the output from commands.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
hows text that should be replaced with user-supplied values or by values determined by context.
Note
This element signifies a general note.
Tip
This element signifies a tip or suggestion.
Warning
This element indicates a warning or caution.
Websites and pages are mentioned in this book to help you locate online information that might be useful. Normally both the address (URL) and the name (or title, or appropriate heading) of a page are mentioned. Some addresses are relatively complicated. You may locate such pages more easily using your favorite search engine to search for a page by its name. This may also help if the page cannot be found by its address; the URL may have changed, but the name may still work.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is available for download at https://github.com/javascripteverywhere/cookbook.
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission .