Secrets: Table of Contents


After all the terrific feedback that I received from my post on the Untold Secrets of JavaScript I began to compile a Table of Contents that would serve as a guide for the rest of my next book (final title or publisher as yet to be determined).

I’d love some feedback as to the structure and contents of the full table of contents, as it stands:

  1. Introduction (Overview of the contents of the book; introduction to its style and format.)
    1. Test-driven book
    2. Test suite and examples
    3. Perf. test suite and examples
    4. The advanced features of the JavaScript Language
    5. How to tackle cross browser code
    6. Overview of best practices

JavaScript Language

Looking at the most advanced features of the JavaScript language, in depth, completely analyzing how they work and how they can best be used to implement incredible production code.

  1. Functions (Explain the importance of functional programming and show it’s severe capabilities and applicability.)
    1. call/apply
    2. arguments slice
    3. Math.sum()
    4. typeof fn == “function”
    5. fn.length
    6. makeClass()
  2. Closures (In-depth explanation of how closures work, their applicability, and usefulness throughout the language.)
    1. How closures work (interactive visual)
    2. Events & Timers
    3. fn.bind()
    4. Currying
    5. Self-replacing functions
    6. (function(){})()
      1. Loops
      2. Library wrapper
      3. Scope / Private Variables
      4. .call(this)
  3. Timers (In-depth explanation of how timers work internally in the JavaScript engine and how to take advantage of them.)
    1. How timers work (interactive visual)
    2. Using closures w/ timers
    3. Central Timer Queue
    4. “Threading” CPU-intesive tasks
  4. Object Prototypes (An overview of prototypes and how they can be used to build complex data structures.)
    1. Gotchyas
    2. Speed benefits
    3. Native Prototypes
    4. Class-like code
    5. Inheritance
    6. Namespacing
  5. RegExp (A deep look at the functionality provided by the JavaScript RegExp engine.)
    1. .replace(re, fn)
    2. Non-capturing RegExp
    3. Backreferences
    4. Pre-Compiled RegExp
    5. Unicode
    6. Escaped characters
  6. with(){} (Understanding how with works – its benefits and how it can be best used.)
    1. Understanding with: Pros and cons
    2. Packages and Namespacing
    3. function test(){with(this){ … }}
    4. Templating
  7. eval (How the eval function can benefit the clarity and functionality of your code in a cross-browser manner.)
    1. new Function
    2. eval.call
    3. <script> eval
    4. Packer

Cross Browser Code

An in-depth look at solving the most common JavaScript tasks in a cross-browser manner. All solutions will be constructed in a robust manner, able to handle all modern browsers.

  1. Strategies for Cross-Browser Code (A look at how to tackle cross-browser issues in real-world, production, code.)
    1. Test Test Test
    2. Defensive writing
    3. Reduce to common denominator
    4. Browser sniffing
  2. CSS Selector Engine (A top-to-bottom look at how to build a pure-JavaScript CSS selector DOM selection engine, including a look at implementing performant features using XPath.)
    1. Overview of CSS Selectors
    2. #id
    3. .class
      1. getElementsByClassName
    4. Descendant selectors (merging, uniqueness)
    5. Attribute selectors
    6. Child selectors
    7. Pseudo selectors
    8. XPath for HTML documents
      1. Translating CSS to XPath
  3. DOM Modification (Analyzing the cross browser issues that occur when dealing with DOM modification, injection, and removal.)
    1. HTML to DOM deserialization
    2. Injecting HTML snippets
    3. Inline Script execution
    4. cloneNode
    5. empty/remove event cleanup
    6. Text contents
  4. Get/Set Attributes (Digging into the nitty-gritty of handling cross browser DOM attribute code.)
    1. Different names (cssText, etc.)
    2. href/src in IE
    3. id in IE/Opera
    4. type in IE
    5. className
    6. Input values
    7. XML Documents
  5. Get/Set CSS (Implementing a completely cross browser CSS access and manipulation implementation, even working when elements are display: none.)
    1. Camelcase / Different names
    2. display: none CSS
    3. Height/Width
      1. Elements
      2. document
      3. window
    4. Opacity
  6. Events (Handling how to work around all of the most common cross browser event issues and looking at how to implement advanced features like custom events and throttling.)
    1. Maintaining ‘this’
    2. Event propagation
    3. Fixing Keyboard Events
      1. Blocking keyboard events
      2. Arrow keys
    4. Fixing Mouse Events
      1. Cursor Position
      2. Position relative to element
    5. Custom Events
    6. Delegation
    7. Throttling
  7. Animations (Look at how to build a full, cross browser, DOM animation engine.)
    1. Tweening
    2. Smooth Animations (Timers)
    3. Stop/Pause

Best Practices

The best techniques that you should employ when developing JavaScript applications. All solutions will look at the deep knowledge and tools needed to build production JavaScript code.

  1. Unit Testing (Looking at the features of existing test suites and implementing our own, from the ground up.)
    1. Components of a Test Suite
    2. Async Testing
  2. Performance Analysis (Looking at the best techniques for improving JavaScript performance coupled with how to analyze those changes with a speed test suite.)
    1. Building a Perf. Test Suite
    2. Firebug
    3. Techniques for improving performance
  3. Validation (Looking at the different validation techniques, how to best understand their results, and apply them to your code.)
    1. Understanding the Pros & Cons
    2. JSLint
    3. JavaScript Lint
    4. Strict
  4. Debugging (How to tackle the debugging of applications and libraries within a variety of browsers.)
    1. Firebug
    2. Test Generation
  5. Distribution (The best techniques for pulling together your JavaScript library for distribution.)
    1. JSMin
    2. Packer
    3. GZip

Web-Exclusive Content

A series of web-only chapters (possibly written by multiple authors) that don’t fit into the normal flow of the book, but are still relevant – and important – to modern JavaScript development.

  1. Text Ranges
  2. WYSIWYG
  3. Rhino
  4. Documentation
    1. JSDoc

Posted: January 9th, 2008


If you particularly enjoy my work, I appreciate donations given with Gittip.

51 Comments (Show Comments)



Comments are closed.
Comments are automatically turned off two weeks after the original post. If you have a question concerning the content of this post, please feel free to contact me.


Secrets of the JavaScript Ninja

Secrets of the JS Ninja

Secret techniques of top JavaScript programmers. Published by Manning.

Ukiyo-e Database and Search

Ukiyo-e.org

Japanese woodblock print database and search engine.


John Resig Twitter Updates

@jeresig

Infrequent, short, updates and links.