JavaScript: The Definitive Guide, 5/e

David Flanagan

  • 出版商: O'Reilly
  • 出版日期: 2006-08-27
  • 售價: $1,860
  • 貴賓價: 9.5$1,767
  • 語言: 英文
  • 頁數: 1032
  • 裝訂: Paperback
  • ISBN: 0596101996
  • ISBN-13: 9780596101992
  • 相關分類: JavaScript
  • 已過版

買這商品的人也買了...

相關主題

商品描述

Description

This Fifth Edition is completely revised and expanded to cover JavaScript as it is used in today's Web 2.0 applications. This book is both an example-driven programmer's guide and a keep-on-your-desk reference, with new chapters that explain everything you need to know to get the most out of JavaScript, including:

  • Scripted HTTP and Ajax
  • XML processing
  • Client-side graphics using the <canvas> tag
  • Namespaces in JavaScript--essential when writing complex programs
  • Classes, closures, persistence, Flash, and JavaScript embedded in Java applications

Part I explains the core JavaScript language in detail. If you are new to JavaScript, it will teach you the language. If you are already a JavaScript programmer, Part I will sharpen your skills and deepen your understanding of the language.

Part II explains the scripting environment provided by web browsers, with a focus on DOM scripting with unobtrusive JavaScript. The broad and deep coverage of client-side JavaScript is illustrated with many sophisticated examples that demonstrate how to:

  • Generate a table of contents for an HTML document
  • Display DHTML animations
  • Automate form validation
  • Draw dynamic pie charts
  • Make HTML elements draggable
  • Define keyboard shortcuts for web applications
  • Create Ajax-enabled tool tips
  • Use XPath and XSLT on XML documents loaded with Ajax
  • And much more

Part III is a complete reference for core JavaScript. It documents every class, object, constructor, method, function, property, and constant defined by JavaScript 1.5 and ECMAScript version 3.

Part IV is a reference for client-side JavaScript, covering legacy web browser APIs, the standard Level 2 DOM API, and emerging standards such as the XMLHttpRequest object and the <canvas> tag.

More than 300,000 JavaScript programmers around the world have made this their indispensable reference book for building JavaScript applications.

"A must-have reference for expert JavaScript programmers...well-organized and detailed."
-- Brendan Eich, creator of JavaScript

 

Table of Contents

Preface

1. Introduction to JavaScript

      1.1 What Is JavaScript?  

      1.2 Versions of JavaScript  

      1.3 Client-Side JavaScript  

      1.4 JavaScript in Other Contexts  

      1.5 Exploring JavaScript  

Part I. Core JavaScript

2. Lexical Structure

      2.1 Character Set  

      2.2 Case Sensitivity  

      2.3 Whitespace and Line Breaks  

      2.4 Optional Semicolons  

      2.5 Comments  

      2.6 Literals  

      2.7 Identifiers  

      2.8 Reserved Words  

3. Datatypes and Values

      3.1 Numbers  

      3.2 Strings  

      3.3 Boolean Values  

      3.4 Functions  

      3.5 Objects  

      3.6 Arrays  

      3.7 null  

      3.8 undefined  

      3.9 The Date Object  

      3.10 Regular Expressions  

      3.11 Error Objects  

      3.12 Type Conversion Summary  

      3.13 Primitive Datatype Wrapper Objects  

      3.14 Object-to-Primitive Conversion  

      3.15 By Value Versus by Reference  

4. Variables

      4.1 Variable Typing  

      4.2 Variable Declaration  

      4.3 Variable Scope  

      4.4 Primitive Types and Reference Types  

      4.5 Garbage Collection  

      4.6 Variables as Properties  

      4.7 Variable Scope Revisited  

5. Expressions and Operators

      5.1 Expressions  

      5.2 Operator Overview  

      5.3 Arithmetic Operators  

      5.4 Equality Operators  

      5.5 Relational Operators  

      5.6 String Operators  

      5.7 Logical Operators  

      5.8 Bitwise Operators  

      5.9 Assignment Operators  

      5.10 Miscellaneous Operators  

6. Statements

      6.1 Expression Statements  

      6.2 Compound Statements  

      6.3 if  

      6.4 else if  

      6.5 switch  

      6.6 while  

      6.7 do/while  

      6.8 for  

      6.9 for/in  

      6.10 Labels  

      6.11 break  

      6.12 continue  

      6.13 var  

      6.14 function  

      6.15 return  

      6.16 throw  

      6.17 try/catch/finally  

      6.18 with  

      6.19 The Empty Statement  

      6.20 Summary of JavaScript Statements  

7. Objects and Arrays

      7.1 Creating Objects  

      7.2 Object Properties  

      7.3 Objects as Associative Arrays  

      7.4 Universal Object Properties and Methods  

      7.5 Arrays  

      7.6 Reading and Writing Array Elements  

      7.7 Array Methods  

      7.8 Array-Like Objects  

8. Functions

      8.1 Defining and Invoking Functions  

      8.2 Function Arguments  

      8.3 Functions as Data  

      8.4 Functions as Methods  

      8.5 Constructor Functions  

      8.6 Function Properties and Methods  

      8.7 Utility Function Examples  

      8.8 Function Scope and Closures  

      8.9 The Function(  ) Constructor  

9. Classes, Constructors, and Prototypes

      9.1 Constructors  

      9.2 Prototypes and Inheritance  

      9.3 Simulating Classes in JavaScript  

      9.4 Common Object Methods  

      9.5 Superclasses and Subclasses  

      9.6 Extending Without Inheriting  

      9.7 Determining Object Type  

      9.8 Example: A defineClass(  ) Utility Method  

10. Modules and Namespaces

      10.1 Creating Modules and Namespaces  

      10.2 Importing Symbols from Namespaces  

      10.3 Module Utilities  

11. Pattern Matching with Regular Expressions

      11.1 Defining Regular Expressions  

      11.2 String Methods for Pattern Matching  

      11.3 The RegExp Object  

12. Scripting Java

      12.1 Embedding JavaScript  

      12.2 Scripting Java  

Part II. Client-Side JavaScript

13. JavaScript in Web Browsers

      13.1 The Web Browser Environment  

      13.2 Embedding Scripts in HTML  

      13.3 Event Handlers in HTML  

      13.4 JavaScript in URLs  

      13.5 Execution of JavaScript Programs  

      13.6 Client-Side Compatibility  

      13.7 Accessibility  

      13.8 JavaScript Security  

      13.9 Other Web-Related JavaScript Embeddings  

14. Scripting Browser Windows

      14.1 Timers  

      14.2 Browser Location and History  

      14.3 Obtaining Window, Screen, and Browser Information  

      14.4 Opening and Manipulating Windows  

      14.5 Simple Dialog Boxes  

      14.6 Scripting the Status Line  

      14.7 Error Handling  

      14.8 Multiple Windows and Frames  

      14.9 Example: A Navigation Bar in a Frame  

15. Scripting Documents

      15.1 Dynamic Document Content  

      15.2 Document Properties  

      15.3 Legacy DOM: Document Object Collections  

      15.4 Overview of the W3C DOM  

      15.5 Traversing a Document  

      15.6 Finding Elements in a Document  

      15.7 Modifying a Document  

      15.8 Adding Content to a Document  

      15.9 Example: A Dynamically Created Table of Contents  

      15.10 Querying Selected Text  

      15.11 The IE 4 DOM  

16. Cascading Style Sheets and Dynamic HTML

      16.1 Overview of CSS  

      16.2 CSS for DHTML  

      16.3 Scripting Inline Styles  

      16.4 Scripting Computed Styles  

      16.5 Scripting CSS Classes  

      16.6 Scripting Stylesheets  

17. Events and Event Handling

      17.1 Basic Event Handling  

      17.2 Advanced Event Handling with DOM Level 2  

      17.3 The Internet Explorer Event Model  

      17.4 Mouse Events  

      17.5 Key Events  

      17.6 The onload Event  

      17.7 Synthetic Events  

18. Forms and Form Elements

      18.1 The Form Object  

      18.2 Defining Form Elements  

      18.3 Scripting Form Elements  

      18.4 Form Verification Example  

19. Cookies and Client-Side Persistence

      19.1 An Overview of Cookies  

      19.2 Storing Cookies  

      19.3 Reading Cookies  

      19.4 Cookie Example  

      19.5 Cookie Alternatives  

      19.6 Persistent Data and Security  

20. Scripting HTTP

      20.1 Using XMLHttpRequest  

      20.2 XMLHttpRequest Examples and Utilities  

      20.3 Ajax and Dynamic Scripting  

      20.4 Scripting HTTP with <script> Tags  

21. JavaScript and XML

      21.1 Obtaining XML Documents  

      21.2 Manipulating XML with the DOM API  

      21.3 Transforming XML with XSLT  

      21.4 Querying XML with XPath  

      21.5 Serializing XML  

      21.6 Expanding HTML Templates with XML Data  

      21.7 XML and Web Services  

      21.8 E4X: ECMAScript for XML  

22. Scripted Client-Side Graphics

      22.1 Scripting Images  

      22.2 Graphics with CSS  

      22.3 SVG: Scalable Vector Graphics  

      22.4 VML: Vector Markup Language  

      22.5 Graphics in a <canvas>  

      22.6 Graphics with Flash  

      22.7 Graphics with Java  

23. Scripting Java Applets and Flash Movies

      23.1 Scripting Applets  

      23.2 Scripting the Java Plug-in  

      23.3 Scripting with Java  

      23.4 Scripting Flash  

      23.5 Scripting Flash 8  

Part III. Core JavaScript Reference

Core JavaScript Reference

Part IV. Client-Side JavaScript Reference

Client-Side JavaScript Reference

Index