Tài liệu Wrox.Professional.JavaScript.For.Web.Developers.2nd.Edition.Jan.2009.eBook-ELOHiM doc - Pdf 96



FireBug, and Drosera; client-side data storage with cookies, the DOM,
and Flash; client-side graphics with JavaScript including SVG, VML, and
Canvas; and design patterns including creational, structural, and behavorial
patterns.
Professional Ajax, 2nd Edition
978-0-470-10949-6
Professional Ajax, 2nd Edition is written for Web application developers
looking to enhance the usability of their web sites and Web applications
and intermediate JavaScript developers looking to further understand
the language. This second edition is updated to cover Prototype, jQuery,
FireBug, Microsoft Fiddler, ASP.NET AJAX Extensions, and much more.
Concise Guide to Dojo
978-0-470-45202-8
Dojo has rapidly become one of the hottest JavaScript based Web
development frameworks. It provides you with the power and flexibility to
create attractive and useful dynamic Web applications quickly and easily.
In this fast-paced, code-intensive guide, you’ll discover how to quickly start
taking advantage of Dojo. The pages are packed with useful information
and insightful examples that will help you.
Beginning JavaScript and CSS Development with jQuery
978-0-470-22779-4
Beginning JavaScript and CSS Development with jQuery presents the
world of dynamic Web applications to Web developers from the standpoint
of modern standards. The author shows new JavaScript developers how
working with the standard jQuery library will help them to do more with less
code and fewer errors.
Beginning JavaScript, 3rd Edition
978-0-470-05151-1
This book aims to teach you all you need to know to start experimenting with JavaScript: what it is, how it works, and what you
can do with it. Starting from the basic syntax, you'll move on to learn how to create powerful Web applications.

for Web Developers
Introduction xxix
Chapter 1: What Is JavaScript? 1
Chapter 2: JavaScript in HTML 13
Chapter 3: Language Basics 23
Chapter 4: Variables, Scope, and Memory 79
Chapter 5: Reference Types 97
Chapter 6: Object-Oriented Programming 151
Chapter 7: Anonymous Functions 183
Chapter 8: The Browser Object Model 201
Chapter 9: Client Detection 229
Chapter 10: The Document Object Model 261
Chapter 11: DOM Levels 2 and 3 317
Chapter 12: Events 365
Chapter 13: Scripting Forms 433
Chapter 14: Error Handling and Debugging 465
Chapter 15: XML in JavaScript 515
Chapter 16: ECMAScript for XML 547
Chapter 17: Ajax and JSON 567
Chapter 18: Advanced Techniques 589
Chapter 19: Client-Side Storage 617
Chapter 20: Best Practices 635
Chapter 21: Upcoming APIs 669
Chapter 22: The Evolution of JavaScript 703
Appendix A: JavaScript Libraries 759
Appendix B: JavaScript Tools 765
Index 773

Professional JavaScript for web developers/Nicholas C. Zakas. — 2nd ed.
p. cm.
Includes index.
ISBN 978-0-470-22780-0 (paper/website)
1. Web site development. 2. JavaScript (Computer program language) I. Title.
TK5105.8885.J38Z34 2008
005.2'762 — dc22
2008045552
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by
any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted
under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written
permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the
Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600.
Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley &
Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at
/>Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or
warranties with respect to the accuracy or completeness of the contents of this work and specifically
disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No
warranty may be created or extended by sales or promotional materials. The advice and strategies contained
herein may not be suitable for every situation. This work is sold with the understanding that the publisher is
not engaged in rendering legal, accounting, or other professional services. If professional assistance is
required, the services of a competent professional person should be sought. Neither the publisher nor the
author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in
this work as a citation and/or a potential source of further information does not mean that the author or the
publisher endorses the information the organization or Web site may provide or recommendations it may
make. Further, readers should be aware that Internet Web sites listed in this work may have changed or
disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department
within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related

Development Editor
Gus Miklos
Production Editor
Rebecca Coleman
Copy Editors
Foxxe Editorial Services, Candace English
Editorial Manager
Mary Beth Wakefield
Production Manager
Tim Tate
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Joseph B. Wikert
Project Coordinator, Cover
Lynsey Stanford
Proofreader
Kathryn Duggan
Indexer
Jack Lewis
CreditsAcknowledgments
It takes many people to create a single book, and I’d like to thank some people here for their
contributions to this work.
First and foremost, thanks to everyone at Wiley for their support: Jim Minatel for once again putting his
faith in me; Kevin Kent for dealing with the hectic outline rearrangements I tend to make throughout
writing; and Alexei Gorkov, the best technical editor in the world, who makes sure that everything I say
is 100-percent accurate.

Case-sensitivity 23
Identifiers 24
Comments 24
Statements 25
Keywords and Reserved Words 25
Variables 26
Data Types 28
The typeof Operator 28
The Undefined Type 28
The Null Type 30

Contents
xvi

The Boolean Type 30
The Number Type 31
The String Type 37
The Object Type 40
Operators 41
Unary Operators 41
Bitwise Operators 45
Boolean Operators 51
Multiplicative Operators 54
Additive Operators 56
Relational Operators 58
Equality Operators 60
Conditional Operator 62
Assignment Operators 62
Comma Operator 63
Statements 63

Summary 94
Chapter 5: Reference Types 97
The Object Type 97
The Array Type 100
Conversion Methods 102
Stack Methods 104
Queue Methods 105
Reordering Methods 106
Manipulation Methods 108
The Date Type 109
Inherited Methods 111
Date-Formatting Methods 112
Date/Time Component Methods 113
The RegExp Type 115
RegExp Instance Properties 117
RegExp Instance Methods 118
RegExp Constructor Properties 120
Pattern Limitations 122
The Function Type 122
No Overloading (Revisited) 123
Function Declarations vs. Function Expressions 124
Functions as Values 125
Function Internals 126
Function Properties and Methods 128
Primitive Wrapper Types 130
The Boolean Type 131
The Number Type 132
The String Type 134
Built-in Objects 142
The Global Object 142

Static Private Variables 195
The Module Pattern 196
The Module-Augmentation Pattern 198
Summary 199
Chapter 8: The Browser Object Model 201
The window Object 201
The Global Scope 201
Window Relationships and Frames 202
Window Position 205
Window Size 206
Navigating and Opening Windows 207
Intervals and Timeouts 211
System Dialogs 213

Contents
xix
The location Object 216
Query String Arguments 216
Manipulating the Location 217
The navigator Object 219
Detecting Plug-ins 221
Registering Handlers 223
The screen Object 224
The history Object 226
Summary 227
Chapter 9: Client Detection 229
Capability Detection 229
Quirks Detection 231
User-Agent Detection 232
History 233

Chapter 11: DOM Levels 2 and 3 317
DOM Changes 317
XML Namespaces 318
Other Changes 322
Styles 326
Accessing Element Styles 326
Working with Style Sheets 331
Element Dimensions 336
Traversals 342
NodeIterator 344
TreeWalker 347
Ranges 349
Ranges in the DOM 349
Ranges in Internet Explorer 358
Summary 362
Chapter 12: Events 365
Event Flow 365
Event Bubbling 366
Event Capturing 367
DOM Event Flow 367
Event Handlers or Listeners 368
HTML Event Handlers 368
DOM Level 0 Event Handlers 369
DOM Level 2 Event Handlers 370
Internet Explorer Event Handlers 372
Cross-Browser Event Handlers 373
The Event Object 375
The DOM Event Object 375
The Internet Explorer Event Object 379
Cross-Browser Event Object 381

Removing Options 455
Moving and Reordering Options 455
Form Serialization 456
Rich Text Editing 458
Interacting with Rich Text 459
Rich Text Selections 462
Rich Text in Forms 463
Summary 464
Chapter 14: Error Handling and Debugging 465
Browser Error Reporting 465
Internet Explorer 465
Firefox 467
Safari 469
Opera 470
Chrome 472

Contents
xxii
Error Handling 473
The try-catch Statement 474
Throwing Errors 477
The error Event 480
Error-Handling Strategies 481
Identify Where Errors Might Occur 481
Distinguishing between Fatal and Nonfatal Errors 486
Log Errors to the Server 487
Debugging Techniques 488
Logging Messages to a Console 488
Logging Messages to the Page 491
Throwing Errors 491

XSLT Support in Browsers 539
XSLT in Internet Explorer 539
The XSLTProcessor Type 543
Cross-Browser XSLT 545
Summary 546
Chapter 16: ECMAScript for XML 547
E4X Types 547
The XML Type 547
The XMLList Type 549
The Namespace Type 550
The QName Type 551
General Usage 552
Accessing Attributes 553
Other Node Types 555
Querying 556
XML Construction and Manipulation 558
Parsing and Serialization Options 560
Namespaces 561
Other Changes 563
Enabling Full E4X 564
Summary 564
Chapter 17: Ajax and JSON 567
The XHR Object 568
XHR Usage 569
HTTP Headers 571
GET Requests 573
POST Requests 574
Browser Differences 575
Security 577
Cross-Domain Requests 578


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status