Now that JavaScript plays such a key role in modern websites, programmers who once dismissed it as a language for amateurs find themselves immersed in JavaScript code. JavaScript Patterns identifies key problem areas you might face when working with the language, and provides coding and design patterns as solutions. JavaScript expert Stoyan Stefanov -- Senior Yahoo! Technical and architect of the performance optimization tool 'YSlow' 2.0 -- includes several examples for each pattern as well as practical advice for implementing it. Learn how to look at your application code through a patterns lens Use code and design patterns to write clean and maintainable JavaScript code Recognize antipatterns -- solutions that create more problems than they solve

In Secrets of the JavaScript Ninja, JavaScript expert John Resig reveals the inside know-how of the elite JavaScript programmers. Written to be accessible to JavaScript developers with intermediate-level skills. This book takes readers on a journey towards mastering modern JavaScript development in three phases: design, construction, and maintenance. It first establishes a base of strong, advanced JavaScript knowledge. The book then teaches readers how to construct a JavaScript library. It examines all the numerous tasks JavaScript libraries have to tackle and provides practical solutions and development strategies. It then presents the various maintenance techniques required to keep their code running well into the future. With Secrets of the JavaScript Ninja readers will gain the knowledge and Ninja-like skills to build their own JavaScript libraries, or to understand how to use any modern JavaScript library available. What's inside: Introduction Testing and debugging Functions Closures Function prototypes Timers Regular expressions With statements Code evaluation Strategies for cross-browser code CSS Selector Engine DOM modification Attributes and CSS Events Ajax Animation Performance