Pro JavaScript Techniques, by John Resig


Table of Contents

This outline represents the complete contents of the "Pro JavaScript Techniques" book. The book is divided into four primary parts (consisting of 14 chapters) with three, additional, appendices.

All code for this book can be found in the code section of this site.

PART 1 - Introducing Modern JavaScript

CHAPTER 1 - Modern JavaScript Programming

  • Object-Oriented JavaScript Page 3
  • Testing Your Code Page 5
  • Packaging for Distribution Page 5
  • Unobtrusive DOM Scripting Page 7
    • The Document Object Model Page 8
    • Events Page 9
    • JavaScript and CSS Page 10
  • Ajax Page 10
  • Browser Support Page 13
  • Summary Page 16

PART 2 - Professional JavaScript Development

CHAPTER 2 - Object-Oriented JavaScript

  • Language Features Page 19
    • References Page 19
    • Function Overloading and Type-Checking Page 21
    • Scope Page 25
    • Closures Page 27
    • Context Page 30
  • Object-Oriented Basics Page 32
    • Objects Page 32
    • Object Creation Page 32
  • Summary Page 38

CHAPTER 3 - Creating Reusable Code

  • Standardizing Object-Oriented Code Page 39
    • Prototypal Inheritance Page 39
    • Classical Inheritance Page 40
    • The Base Library Page 44
    • The Prototype Library Page 45
  • Packaging Page 49
    • Namespacing Page 49
    • Cleaning Up Your Code Page 52
    • Compression Page 54
  • Distribution Page 56
  • Summary Page 58

CHAPTER 4 - Tools for Debugging and Testing

  • Debugging Page 59
    • Error Console Page 59
    • DOM Inspectors Page 64
    • Firebug Page 67
    • Venkman Page 67
  • Testing Page 68
    • JSUnit Page 69
    • J3Unit Page 71
    • Test.Simple Page 72
  • Summary Page 73

PART 3 - Unobtrusive JavaScript

CHAPTER 5 - The Document Object Model

  • An Introduction to the Document Object Model Page 77
  • Navigating the DOM Page 77
    • Handling White Space in the DOM Page 80
    • Simple DOM Navigation Page 82
    • Binding to Every HTML Element Page 84
    • Standard DOM Methods Page 85
  • Waiting for the HTML DOM to Load Page 87
    • Waiting for the Page to Load Page 87
    • Waiting for Most of the DOM to Load Page 87
    • Figuring Out When the DOM Is Loaded Page 88
  • Finding Elements in an HTML Document Page 91
    • Finding Elements by Class Name Page 91
    • Finding Elements by CSS Selector Page 92
    • XPath Page 95
  • Getting the Contents of an Element Page 96
    • Getting the Text Inside an Element Page 96
    • Getting the HTML Inside an Element Page 98
  • Working with Element Attributes Page 99
    • Getting and Setting an Attribute Value Page 99
  • Modifying the DOM Page 103
    • Creating Nodes Using the DOM Page 103
    • Inserting into the DOM Page 104
    • Injecting HTML into the DOM Page 105
    • Removing Nodes from the DOM Page 108
  • Summary Page 110

CHAPTER 6 - Events

  • Introduction to JavaScript Events Page 111
    • Asynchronous Events vs Threads Page 111
    • Event Phases Page 114
  • Common Event Features Page 116
    • The Event Object Page 116
    • The this Keyword Page 117
    • Canceling Event Bubbling Page 118
    • Overriding the Browser's Default Action Page 119
  • Binding Event Listeners Page 122
    • Traditional Binding Page 122
    • DOM Binding: W3C Page 124
    • DOM Binding: IE Page 125
    • addEvent and removeEvent Page 126
  • Types of Events Page 129
  • Unobtrusive DOM Scripting Page 129
    • Anticipating JavaScript Being Disabled Page 130
    • Making Sure Links Don't Rely on JavaScript Page 130
    • Watching for When CSS Is Disabled Page 131
    • Event Accessibility Page 132
  • Summary Page 133

CHAPTER 7 - JavaScript and CSS

  • Accessing Style Information Page 135
  • Dynamic Elements Page 137
    • An Element's Position Page 137
    • An Element's Size Page 147
    • An Element's Visibility Page 149
  • Animations Page 151
    • Slide In Page 152
    • Fade In Page 152
  • The Browser Page 153
    • Mouse Position Page 153
    • The Viewport Page 155
  • Drag-and-Drop Page 157
  • Libraries Page 163
    • moo.fx and jQuery Page 163
    • Scriptaculous Page 164
  • Summary Page 167

CHAPTER 8 - Improving Forms

  • Form Validation Page 169
    • Required Fields Page 172
    • Pattern Matching Page 174
    • Rule Set Page 177
  • Displaying Error Messages Page 179
    • Validation Page 179
    • When to Validate Page 183
  • Usability Improvements Page 186
    • Hover Labels Page 186
    • Marking Required Fields Page 188
  • Summary Page 189

CHAPTER 9 - Building an Image Gallery

  • Example Galleries Page 191
    • Lightbox Page 191
    • ThickBox Page 193
  • Building the Gallery Page 195
    • Loading Unobtrusively Page 198
    • Transparent Overlay Page 200
    • Positioned Box Page 203
    • Navigation Page 207
    • Slideshow Page 209
  • Summary Page 212

PART 4 - Ajax

CHAPTER 10 - Introduction to Ajax

  • Using Ajax Page 215
    • HTTP Requests Page 216
    • HTTP Response Page 221
  • Handling Response Data Page 225
  • The Complete Ajax Package Page 226
  • Examples of Different Data Usage Page 229
    • An XML-Based RSS Feed Page 229
    • An HTML Injector Page 231
    • JSON and JavaScript: Remote Execution Page 232
  • Summary Page 232

CHAPTER 11 - Enhancing Blogs with Ajax

  • Never-Ending Blog Page 233
    • The Blog Template Page 234
    • The Data Source Page 236
    • Event Detection Page 238
    • The Request Page 238
    • The Result Page 239
  • Live Blogging Page 243
  • Summary Page 245

CHAPTER 12 - Autocomplete Search

  • Examples of Autocomplete Search Page 247
  • Building the Page Page 249
  • Watching for Key Input Page 251
  • Retrieving the Results Page 254
  • Navigating the Result List Page 257
    • Keyboard Navigation Page 257
    • Mouse Navigation Page 258
  • The Final Result Page 259
  • Summary Page 264

CHAPTER 13 - An Ajax Wiki

  • What Is a Wiki? Page 265
  • Talking With the Database Page 266
  • The Ajax Request Page 267
  • The Server-Side Code Page 268
    • Handling a Request Page 268
    • Executing and Formatting SQL Page 270
  • Handling the JSON Response Page 272
  • An Extra Case Study: A JavaScript Blog Page 274
  • Application Code Page 275
    • Core JavaScript Code Page 276
    • JavaScript SQL Library Page 279
    • Ruby Server-Side Code Page 280
  • Summary Page 283

PART 5 - The Future of JavaScript

CHAPTER 14 - Where Is JavaScript Going?

  • JavaScript 1.6 and 1.7 Page 287
    • JavaScript 1.6 Page 288
    • JavaScript 1.7 Page 291
  • Web Applications 1.0 Page 294
    • Building a Clock Page 294
    • Simple Planet Simulation Page 298
  • Comet Page 301
  • Summary Page 304

PART 6 - Appendixes

APPENDIX A - DOM Reference

  • Resources Page 307
  • Terminology Page 307
  • Global Variables Page 309
    • document Page 309
    • HTMLElement Page 310
  • DOM Navigation Page 310
    • body Page 310
    • childNodes Page 311
    • documentElement Page 311
    • firstChild Page 311
    • getElementById( elemID ) Page 311
    • getElementsByTagName( tagName ) Page 312
    • lastChild Page 312
    • nextSibling Page 313
    • parentNode Page 313
    • previousSibling Page 314
    • Node Information Page 314
    • innerText Page 314
    • nodeName Page 315
    • nodeType Page 315
    • nodeValue Page 316
  • Attributes Page 316
    • className Page 316
    • getAttribute( attrName ) Page 317
    • removeAttribute( attrName ) Page 317
    • setAttribute( attrName, attrValue ) Page 318
  • DOM Modification Page 319
    • appendChild( nodeToAppend ) Page 319
    • cloneNode( true|false ) Page 319
    • createElement( tagName ) Page 320
    • createElementNS( namespace, tagName ) Page 320
    • createTextNode( textString ) Page 321
    • innerHTML Page 321
    • insertBefore( nodeToInsert, nodeToInsertBefore ) Page 322
    • removeChild( nodeToRemove ) Page 322
    • replaceChild( nodeToInsert, nodeToReplace ) Page 323

APPENDIX B - Events Reference

  • Resources Page 325
  • Terminology Page 325
  • Event Object Page 326
    • General Properties Page 327
    • Mouse Properties Page 329
    • Keyboard Properties Page 332
  • Page Events Page 334
    • load Page 334
    • beforeunload Page 335
    • error Page 335
    • resize Page 336
    • scroll Page 336
    • unload Page 336
  • UI Events Page 337
    • focus Page 337
    • blur Page 337
  • Mouse Events Page 337
    • click Page 337
    • dblclick Page 338
    • mousedown Page 338
    • mouseup Page 338
    • mousemove Page 338
    • mouseover Page 340
    • mouseout Page 340
  • Keyboard Events Page 341
    • keydown / keypress Page 341
    • keyup Page 341
  • Form Events Page 342
    • select Page 342
    • change Page 342
    • submit Page 342
    • reset Page 343

APPENDIX C - The Browsers

  • Modern Browsers Page 345
    • Internet Explorer Page 345
    • Mozilla Page 346
    • Safari Page 346
    • Opera Page 346

Pro JavaScript Techniques

  • By John Resig
  • Published December 11th, 2006 – by Apress
  • ISBN 1590597273, 350 Pages
  • Technical Reviewer: Dan Webb
  • Who's Talking About it?
  • United States (USA)
  • United Kingdom (UK)
  • Canada
  • Japan
  • Germany
  • France

Paperback Release Date: December 11th, 2006!

More about the book...

  • Table of Contents
  • Case Studies
  • Code
  • Reviews
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.