Cover image for JavaScript : the definitive guide
Title:
JavaScript : the definitive guide
Author:
Flanagan, David.
Personal Author:
Edition:
Third edition.
Publication Information:
Cambridge ; Sebastopol, CA : O'Reilly & Associates, [1998]

©1998
Physical Description:
xiv, 776 pages : illustrations ; 24 cm.
General Note:
Includes index.
Language:
English
Contents:
Introduction to JavaScript -- Lexical structure -- Data types and values -- Variables -- Expressions and operators -- Statements -- Functions -- Objects -- Arrays -- Pattern matching with regular expressions -- Further topics in JavaScript -- JavaScript in Web browsers -- Windows and frames -- The document object model -- Events and event-handling -- Forms and form elements -- Dynamic HTML -- Saving state with cookies -- Compatibility techniques -- LiveConnect : JavaScript and Java -- JavaScript security.
ISBN:
9781565923928
Format :
Book

Available:*

Library
Call Number
Material Type
Home Location
Status
Item Holds
Searching...
QA76.73.J38 F555 1998 Adult Non-Fiction Central Closed Stacks
Searching...

On Order

Summary

Summary

JavaScript is a powerful scripting language that can be embedded directly in HTML. It allows you to create dynamic, interactive Web-based applications that run completely within a Web browser; you don't have to do any server-side programming, like writing CGI scripts.JavaScript is a simpler language than Java. It can be embedded directly in Web pages without compilation, so it is more flexible and easier to use for simple tasks like animation. However, although you can write reasonably robust and complete Web applications using JavaScript alone, JavaScript is not a substitute for Java. In fact, JavaScript is a good client-side complement to Java; using the two together allows you to create more complex applications than are possible with JavaScript alone. JavaScript: The Definitive Guide provides a thorough description of the core JavaScript language and its client-side framework, complete with sophisticated examples that show you how to handle common tasks, like validating form data and working with cookies. The book also contains a definitive, in-depth reference section that covers every core and client-side JavaScript function, object, method, property, constructor, and event handler. This book is an indispensable reference for all JavaScript programmers, regardless of experience level.This third edition of JavaScript: The Definitive Guide describes the latest version of the language, JavaScript 1.2, as supported by Netscape Navigator 4 and Internet Explorer 4. The book also covers JavaScript 1.1, which is the first industry-standard version known as ECMAScript. The new features of JavaScript 1.2, which are likely to be embodied in a later ECMAScript standard release, are clearly indicated, so that you can use them as appropriate in your scripts.


Author Notes

David Flanagan graduated from the Massachusetts Institute of Technology. He is a consulting computer programmer, user interface designer and trainer.

His books include X Toolkit Intrinsics Reference Manual and Motif Tools: Streamlined GUI Design and Programming with the Xmt Library.

(Bowker Author Biography)


Table of Contents

Prefacep. xiii
1. Introduction to JavaScriptp. 1
JavaScript Mythsp. 2
Versions of JavaScriptp. 2
Client-Side JavaScriptp. 3
JavaScript in Other Contextsp. 5
Client-Side JavaScript: Executable Content in Web Pagesp. 6
Client-Side JavaScript Featuresp. 8
JavaScript Securityp. 12
Example: Computing Loan Payments with JavaScriptp. 12
Using the Rest of This Bookp. 16
Exploring JavaScriptp. 18
Part I. Core JavaScript
2. Lexical Structurep. 23
Character Setp. 23
Case Sensitivityp. 24
Whitespace and Line Breaksp. 24
Optional Semicolonsp. 24
Commentsp. 25
Literalsp. 26
Identifiersp. 26
Reserved Wordsp. 27
3. Data Types and Valuesp. 29
Numbersp. 30
Stringsp. 33
Boolean Valuesp. 36
Functionsp. 37
Objectsp. 39
Arraysp. 40
nullp. 42
undefinedp. 42
The Date Objectp. 43
Regular Expressionsp. 43
Error Objectsp. 44
Primitive Data Type Wrapper Objectsp. 44
4. Variablesp. 46
Variable Typingp. 46
Variable Declarationp. 47
Variable Scopep. 48
Primitive Types and Reference Typesp. 50
Garbage Collectionp. 52
Variables as Propertiesp. 53
Variable Scope Revisitedp. 54
5. Expressions and Operatorsp. 56
Expressionsp. 56
Operator Overviewp. 57
Arithmetic Operatorsp. 60
Equality Operatorsp. 62
Relational Operatorsp. 65
String Operatorsp. 67
Logical Operatorsp. 68
Bitwise Operatorsp. 70
Assignment Operatorsp. 72
Miscellaneous Operatorsp. 73
6. Statementsp. 79
Expression Statementsp. 79
Compound Statementsp. 80
ifp. 81
else ifp. 82
switchp. 83
whilep. 86
do/whilep. 87
forp. 87
for/inp. 89
Labelsp. 90
breakp. 90
continuep. 92
varp. 93
functionp. 93
returnp. 95
throwp. 95
try/catch/finallyp. 96
withp. 98
The Empty Statementp. 99
Summary of JavaScript Statementsp. 100
7. Functionsp. 102
Defining and Invoking Functionsp. 102
Functions as Datap. 106
Function Scope: The Call Objectp. 108
Function Arguments: The Arguments Objectp. 109
Function Properties and Methodsp. 111
8. Objectsp. 114
Objects and Propertiesp. 114
Constructorsp. 116
Methodsp. 117
Prototypes and Inheritancep. 120
Object-Oriented JavaScriptp. 123
Objects as Associative Arraysp. 130
Object Properties and Methodsp. 132
9. Arraysp. 138
Arrays and Array Elementsp. 138
Array Methodsp. 142
10. Pattern Matching with Regular Expressionsp. 147
Defining Regular Expressionsp. 147
String Methods for Pattern Matchingp. 156
The RegExp Objectp. 158
11. Further Topics in JavaScriptp. 161
Data Type Conversionp. 161
By Value Versus by Referencep. 166
Garbage Collectionp. 171
Lexical Scoping and Nested Functionsp. 173
The Function() Constructor and Function Literalsp. 175
Netscape's JavaScript 1.2 Incompatibilitiesp. 175
Part II. Client-Side JavaScript
12. JavaScript in Web Browsersp. 181
The Web Browser Environmentp. 181
Embedding JavaScript in HTMLp. 185
Execution of JavaScript Programsp. 193
13. Windows and Framesp. 199
Window Overviewp. 199
Simple Dialog Boxesp. 201
The Status Linep. 203
Timeouts and Intervalsp. 204
Error Handlingp. 206
The Navigator Objectp. 207
The Screen Objectp. 209
Window Control Methodsp. 209
The Location Objectp. 213
The History Objectp. 215
Multiple Windows and Framesp. 218
14. The Document Objectp. 225
Document Overviewp. 225
Dynamically Generated Documentsp. 230
Document Color Propertiesp. 235
Document Information Propertiesp. 235
Formsp. 236
Imagesp. 236
Linksp. 243
Anchorsp. 245
Appletsp. 247
Embedded Datap. 248
15. Forms and Form Elementsp. 249
The Form Objectp. 250
Defining Form Elementsp. 251
Scripting Form Elementsp. 255
Form Verification Examplep. 263
16. Scripting Cookiesp. 266
An Overview of Cookiesp. 266
Storing Cookiesp. 268
Reading Cookiesp. 269
Cookie Examplep. 270
17. The Document Object Modelp. 274
An Overview of the DOMp. 274
Using the Core DOM APIp. 285
DOM Compatibility with Internet Explorer 4p. 303
DOM Compatibility with Netscape 4p. 305
Convenience Methods: The Traversal and Range APIsp. 306
18. Cascading Style Sheets and Dynamic HTMLp. 314
Styles and Style Sheets with CSSp. 315
Element Positioning with CSSp. 322
Scripting Stylesp. 332
DHTML in Fourth-Generation Browsersp. 341
Other DOM APIs for Styles and Style Sheetsp. 345
19. Events and Event Handlingp. 351
Basic Event Handlingp. 352
Advanced Event Handling with DOM Level 2p. 361
The Internet Explorer Event Modelp. 376
The Netscape 4 Event Modelp. 382
20. Compatibility Techniquesp. 387
Platform and Browser Compatibilityp. 387
Language Version Compatibilityp. 392
Compatibility with Non-JavaScript Browsersp. 396
21. JavaScript Securityp. 399
JavaScript and Securityp. 399
Restricted Featuresp. 400
The Same-Origin Policyp. 402
Security Zones and Signed Scriptsp. 403
22. Using Java with JavaScriptp. 405
Scripting Java Appletsp. 405
Using JavaScript from Javap. 407
Using Java Classes Directlyp. 411
LiveConnect Data Typesp. 413
LiveConnect Data Conversionp. 418
JavaScript Conversion of JavaObjectsp. 421
Java-to-JavaScript Data Conversionp. 423
Part III. Core JavaScript Reference
Core JavaScript Referencep. 427
Part IV. Client-Side JavaScript Reference
Client-Side JavaScript Referencep. 541
Part V. W3C DOM Reference
W3C DOM Referencep. 685
Part VI. Class, Property, Method, and Event Handler Index
Class, Property, Method, and Event Handler Indexp. 857
Indexp. 871