Kevin Yank, Cameron Adams0980285801, 9780980285802
Table of contents :
Simply JavaScript……Page 1
Table of Contents……Page 9
Preface……Page 17
What’s Covered in this Book?……Page 18
Updates and Errata……Page 20
Kevin Yank……Page 21
Cameron Adams……Page 22
Code Samples……Page 23
Tips, Notes, and Warnings……Page 24
1. The Three Layers of the Web……Page 25
Keep ’em Separated……Page 26
Three Layers……Page 28
HTML for Content……Page 30
CSS for Presentation……Page 32
JavaScript for Behavior……Page 33
JavaScript Libraries……Page 35
Let’s Get Started!……Page 36
2. Programming with JavaScript……Page 37
Running a JavaScript Program……Page 38
Statements: Bite-sized Chunks for your Browser……Page 41
Comments: Bite-sized Chunks Just for You……Page 42
Variables: Storing Data for your Program……Page 43
Numbers……Page 47
Mathematical Operations……Page 48
Strings……Page 51
String Operations……Page 53
Arrays……Page 54
Associative Arrays……Page 58
Conditions and Loops: Controlling Program Flow……Page 59
if Statements……Page 60
Multiple Conditions……Page 64
if-else Statements……Page 65
else-if Statements……Page 66
while Loops……Page 67
for Loops……Page 70
Functions: Writing Code for Later……Page 72
Arguments: Passing Data to a Function……Page 74
Return Statements: Outputting Data from a Function……Page 76
Scope: Keeping your Variables Separate……Page 78
Objects……Page 79
Unobtrusive Scripting in the Real World……Page 82
Summary……Page 83
The Document Object Model: Mapping your HTML……Page 85
Text Nodes……Page 88
Attribute Nodes……Page 89
Accessing the Nodes you Want……Page 90
Finding an Element by ID……Page 91
Finding Elements by Tag Name……Page 94
Restricting Tag Name Selection……Page 96
Starting your First Function……Page 98
Looking at All the Elements……Page 99
Checking the Class of Each Element……Page 100
Adding Matching Elements to our Group of Elements……Page 101
Putting it All Together……Page 102
Navigating the DOM Tree……Page 103
Finding Children……Page 104
Finding Siblings……Page 105
Interacting with Attributes……Page 106
Getting an Attribute……Page 107
Setting an Attribute……Page 108
Changing Styles……Page 109
Changing Styles with Class……Page 111
Comparing Classes……Page 112
Adding a Class……Page 113
Removing a Class……Page 115
Example: Making Stripy Tables……Page 116
Finding All Tables with Class dataTable……Page 117
Getting the Table Rows for Each Table……Page 118
Putting it All Together……Page 120
Prototype……Page 123
jQuery……Page 124
Summary……Page 126
4. Events……Page 129
An Eventful History……Page 130
Event Handlers……Page 131
Default Actions……Page 135
The this Keyword……Page 136
The Problem with Event Handlers……Page 139
Event Listeners……Page 140
Default Actions……Page 143
Event Propagation……Page 146
The this Keyword……Page 151
The Internet Explorer Memory Leak……Page 152
Putting it All Together……Page 153
Example: Rich Tooltips……Page 156
The Static Page……Page 157
Making Things Happen……Page 158
The Workhorse Methods……Page 159
The Dynamic Styles……Page 164
Putting it All Together……Page 166
The Static Page……Page 168
The Workhorse Methods……Page 170
The Dynamic Styles……Page 172
Putting it All Together……Page 174
Exploring Libraries……Page 182
Summary……Page 184
The Principles of Animation……Page 187
Controlling Time with JavaScript……Page 189
Using Variables with setTimeout……Page 192
Stopping the Timer……Page 196
Creating a Repeating Timer……Page 198
Revisiting Rich Tooltips……Page 199
Old-school Animation in a New-school Style……Page 200
Path-based Motion……Page 205
Animating in Two Dimensions……Page 214
Creating Realistic Movement……Page 216
Faster!……Page 219
Making the Accordion Look Like it’s Animated……Page 222
Changing the Code……Page 223
script.aculo.us……Page 232
Summary……Page 235
6. Form Enhancements……Page 237
HTML DOM Extensions……Page 238
Example: Dependent Fields……Page 240
Example: Cascading Menus……Page 250
Form Validation……Page 263
Intercepting Form Submissions……Page 264
Regular Expressions……Page 267
Example: Reusable Validation Script……Page 273
Example: Slider……Page 280
Exploring Libraries……Page 295
Form Validation……Page 296
Custom Controls……Page 298
Summary……Page 299
7. Errors and Debugging……Page 301
Nothing Happened!……Page 302
Common Errors……Page 306
Syntax Errors……Page 307
Runtime Errors……Page 312
Logic Errors……Page 316
Debugging with Firebug……Page 320
Summary……Page 327
8 .Ajax……Page 329
XMLHttpRequest: Chewing Bite-sized Chunks of Content……Page 330
Creating an XMLHttpRequest Object……Page 331
Calling a Server……Page 334
Dealing with Data……Page 338
Putting Ajax into Action……Page 340
Seamless Form Submission with Ajax……Page 353
Exploring Libraries……Page 361
Prototype……Page 363
Dojo……Page 364
YUI……Page 365
MooTools……Page 366
Summary……Page 367
9. Looking Forward……Page 369
Easy Exploration……Page 370
Easy Visualization……Page 371
Unique Interaction……Page 373
Rich Internet Applications……Page 376
Widgets……Page 379
JavaScript Off the Web……Page 380
Exploring Libraries……Page 381
Dojo……Page 382
Google Web Toolkit……Page 385
Summary……Page 386
The Object……Page 387
Event Listener Methods……Page 388
Script Bootstrapping……Page 399
CSS Class Management Methods……Page 402
The Complete Library……Page 403
Index……Page 411
Reviews
There are no reviews yet.