Skip to content

Secrets of the JavaScript Ninja

Best in textbook rentals since 2012!

ISBN-10: 193398869X

ISBN-13: 9781933988696

Edition: 2009

Authors: John John Resig, Bear Bear Bibeault

List price: $39.99
Blue ribbon 30 day, 100% satisfaction guarantee!
what's this?
Rush Rewards U
Members Receive:
Carrot Coin icon
XP icon
You have reached 400 XP and carrot coins. That is the daily max!

Description:

In Secrets of the JavaScript Ninja, JavaScript expert John Resig reveals theinside know-how of the elite JavaScript programmers. Written to be accessibleto JavaScript developers with intermediate-level skills.This book takes readers on a journey towards mastering modern JavaScriptdevelopment in three phases: design, construction, and maintenance. It firstestablishes a base of strong, advanced JavaScript knowledge. The book thenteaches readers how to construct a JavaScript library. It examines all the numeroustasks JavaScript libraries have to tackle and provides practical solutions anddevelopment strategies. It then presents the various maintenance techniquesrequired to keep their code…    
Customers also bought

Book details

List price: $39.99
Copyright year: 2009
Publisher: Manning Publications Company
Publication date: 1/17/2013
Binding: Paperback
Pages: 392
Size: 8.00" wide x 9.50" long x 1.00" tall
Weight: 1.430
Language: English

John Resig is the Dean of Open Source and head of JavaScript development at Khan Academy and the author of the book Pro JavaScript Techniques. He's also the creator and lead developer of the jQuery JavaScript library.

preface
acknowledgments
about this book
about the authors
Preparing for Training
Enter the ninja
The JavaScript libraries we'll be tapping
Understanding the JavaScript language
Cross-browser considerations
Current best practices
Current best practice: testing
Current best practice: performance analysis
Summary
Arming with testing and debugging
Debugging code
Logging
Breakpoints
Test generation
Testing frameworks
QUnit
YUI Test
JsUnit
Newer unit-testing frameworks
The fundamentals of a test suite
The assertion
Test groups
Asynchronous testing
Summary
Apprentice Training
Functions are fundamental
What's with the functional difference?
Why is JavaScript's functional nature important?
Sorting with a comparator
Declarations
Scoping and functions
Invocations
From arguments to function parameters
Invocation as a function
Invocation as a method
Invocation as a constructor
Invocation with the apply() and call() methods
Summary
Wielding functions
Anonymous functions
Recursion
Recursion in named functions
Recursion with methods
The pilfered reference problem
Inline named functions
The callee property
Fun with function as objects
Storing functions
Self-memoizing functions
Faking array methods
Variable-length argument lists
Using apply() to supply variable arguments
Function overloading
Checking for functions
Summary
Closing in on closures
How closures work
Putting closures to work
Private variables
Callbacks and timers
Binding function contexts
Partially applying functions
Overriding function behavior
Memoization
Function wrapping
Immediate functions
Temporary scope and private variables
Loops
Library wrapping
Summary
Object-orientation with prototypes
Instantiation and prototypes
Object instantiation
Object typing via constructors
Inheritance and the prototype chain
HTML DOM prototypes
The gotchas!
Extending Object
Extending Number
Subclassing native objects
Instantiation issues
Writing class-like code
Checking for function serializability
Initialization of subclasses
Preserving super-methods
Summary
Wrangling regular expressions
Why regular expressions rock
A regular expression refresher
Regular expressions explained
Terms and operators
Compiling regular expressions
Capturing matching segments
Performing simple captures
Matching using global expressions
Referencing captures
Non-capturing groups
Replacing using functions
Solving common problems with regular expressions
Trimming a string
Matching newlines
Unicode
Escaped characters
Summary
Taming threads and timers
How timers and threading work
Setting and clearing timers
Timer execution within the execution thread
Differences between timeouts and intervals
Minimum timer delay and reliability
Dealing with computationally expensive processing
Central timer control
Asynchronous testing
Summary
Ninja Training
Ninja alchemy: runtime code evaluation
Code evaluation mechanisms
Evaluation with the eval() method
Evaluation via the Function constructor
Evaluation with timers
Evaluation in the global scope
Safe code evaluation
Function "decompilation"
Code evaluation in action
Converting JSON
Importing namespaced code
JavaScript compression and obfuscation
Dynamic code rewriting
Aspect-oriented script tags
Metalanguages and DSLs
Summary
With statements
What's with "with"?
Referencing properties within a with scope
Assignments within a with scope
Performance considerations
Real-world examples
Importing namespaced code
Testing
Templating with "with"
Summary
Developing cross-browser strategies
Choosing which browsers to support
The five major development concerns
Browser bugs and differences
Browser bug fixes
Living with external code and markup
Missing features
Regressions
Implementation strategies
Safe cross-browser fixes
Object detection
Feature simulation
Untestable browser issues
Reducing assumptions
Summary
Cutting through attributes, properties, and CSS
DOM attributes and properties
Cross-browser naming
Naming restrictions
Differences between XML and HTML
Behavior of custom attributes
Performance considerations
Cross-browser attribute issues
DOM id/name expansion
URL normalization
The style attribute
The type attribute
The tab index problem
Node names
Styling attribute headaches
Where are my styles?
Style property naming
The float style property
Conversion of pixel values
Measuring heights and widths
Seeing through opacity
Riding the color wheel
Fetching computed styles
Summary
Master Training
Surviving events
Binding and unbinding event handlers
The Event object
Handler management
Centrally storing associated information
Managing event handlers
Triggering events
Custom events
Bubbling and delegation
Delegating events to an ancestor
Working around browser deficiencies
The document ready event
Summary
Manipulating the DOM
Injecting HTML into the DOM
Converting HTML to DOM
Inserting into the document
Script execution
Cloning elements
Removing elements
Text contents
Setting text
Getting text
Summary
CSS selector engines
The W3C Selectors API
Using XPath to find elements
The pure-DOM implementation
Parsing the selector
Finding the elements
Filtering the set
Recursing and merging
Bottom-up selector engine
Summary
index