JavaScript is the ubiquitous programming language of the Web, and for more than 15 years, JavaScript: The Definitive Guide has been the bible of JavaScript programmers around the world. This book is an all-new excerpt of The Definitive Guide, collecting the essential parts of that hefty volume into this slim yet dense pocket reference.
The first 9 chapters document the latest version (ECMAScript 5) of the core JavaScript language, covering:
-
Types, values, and variables
-
Operators, expressions, and statements
-
Objects and arrays
-
Functions and classes
The next 5 chapters document the fundamental APIs for using JavaScript with HTML5 and explain how to:
-
Interact with web browser windows
-
Script HTML documents and document elements
-
Modify and apply CSS styles and classes
-
Respond to user input events
-
Communicate with web servers
-
Store data locally on the user's computer
-
This book is a perfect companion to jQuery Pocket Reference.
About the Author
David Flanagan is a JavaScript programmer at Mozilla. His books with O’Reilly include JavaScript: The Definitive Guide, jQuery Pocket Reference, The Ruby Programming Language, and Java in a Nutshell. David has a degree in computer science and engineering from the Massachusetts Institute of Technology. He lives with his wife and children in the U.S. Pacific Northwest between the cities of Seattle, Washington, and Vancouver, British Columbia. David has a blog at http://www.davidflanagan.com/.
Table of Contents
Chapter 1 Lexical Structure
-
Comments
-
Identifiers and Reserved Words
-
Optional Semicolons
Chapter 2 Types, Values, and Variables
-
Numbers
-
Text
-
Boolean Values
-
null and undefined
-
The Global Object
-
Type Conversions
-
Variable Declaration
Chapter 3 Expressions and Operators
-
Expressions
-
Operators
-
Arithmetic Operators
-
Relational Operators
-
Logical Expressions
-
Assignment Expressions
-
Evaluation Expressions
-
Miscellaneous Operators
Chapter 4 Statements
-
Expression Statements
-
Compound and Empty Statements
-
Declaration Statements
-
Conditionals
-
Loops
-
Jumps
-
Miscellaneous Statements
Chapter 5 Objects
-
Creating Objects
-
Properties
-
Object Attributes
Chapter 6 Arrays
-
Creating Arrays
-
Array Elements and Length
-
Iterating Arrays
-
Multidimensional Arrays
-
Array Methods
-
ECMAScript 5 Array Methods
-
Array Type
-
Array-Like Objects
-
Strings as Arrays
Chapter 7 Functions
-
Defining Functions
-
Invoking Functions
-
Function Arguments and Parameters
-
Functions as Namespaces
-
Closures
-
Function Properties, Methods, and Constructor
Chapter 8 Classes
-
Classes and Prototypes
-
Classes and Constructors
-
Java-Style Classes in JavaScript
-
Immutable Classes
-
Subclasses
-
Augmenting Classes
Chapter 9 Regular Expressions
-
Describing Patterns with Regular Expressions
-
Matching Patterns with Regular Expressions
Chapter 10 Client-Side JavaScript
-
Embedding JavaScript in HTML
-
Event-Driven Programming
-
The Window Object
Chapter 11 Scripting Documents
-
Overview of the DOM
-
Selecting Document Elements
-
Document Structure and Traversal
-
Attributes
-
Element Content
-
Creating, Inserting, and Deleting Nodes
-
Element Style
-
Geometry and Scrolling
Chapter 12 Handling Events
-
Types of Events
-
Registering Event Handlers
-
Event Handler Invocation
Chapter 13 Networking
-
Using XMLHttpRequest
-
HTTP by <script>: JSONP
-
Server-Sent Events
-
WebSockets
Chapter 14 Client-Side Storage
-
localStorage and session Storage
-
Cookies
-
Colophon