Programming Books C Java PHP Python Learn more Browse Programming Books

Sorry, this item is not available in
Image not available for
Image not available

To view this video download Flash Player


Sign in to turn on 1-Click ordering
Sell Us Your Item
For a $7.67 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Secrets of the JavaScript Ninja [Paperback]

by John Resig, Bear Bibeault
4.7 out of 5 stars  See all reviews (55 customer reviews)

List Price: $39.99
Price: $23.99 & FREE Shipping on orders over $35. Details
You Save: $16.00 (40%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Gift-wrap available.
Want it tomorrow, April 25? Choose One-Day Shipping at checkout. Details
Free Two-Day Shipping for College Students with Amazon Student

Shop the new
New! Introducing the, a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Book Description

December 28, 2012 193398869X 978-1933988696 1


Secrets of the Javascript Ninja takes you on a journey towards mastering modern JavaScript development in three phases: design, construction, and maintenance. Written for JavaScript developers with intermediate-level skills, this book will give you the knowledge you need to create a cross-browser JavaScript library from the ground up.

About this Book

You can't always attack software head-on. Sometimes you come at it sideways or sneak up from behind. You need to master an arsenal of tools and know every stealthy trick. You have to be a ninja.

Secrets of the JavaScript Ninja leads you down the pathway to JavaScript enlightenment. This unique book starts with key concepts, like the relationships between functions, objects, and closures, taught from the master's perspective. You'll grow from apprentice to ninja as you soak up fresh insights on the techniques you use every day and discover features and capabilities you never knew about. When you reach the final chapters, you'll be ready to code brilliant JavaScript applications and maybe even write your own libraries and frameworks.

You don't have to be a ninja to read this book—just be willing to become one. Are you ready?

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

What's Inside

  • Functions, objects, closures, regular expressions, and more
  • Seeing applications and libraries from the right perspective
  • Dealing with the complexities of cross-browser development
  • Modern JavaScript design

About the Authors

John Resig is an acknowledged JavaScript authority and the creator of the jQuery library. Bear Bibeault is a web developer and coauthor of Ajax in Practice, Prototype and Scriptaculous in Action, and jQuery in Action from Manning.

Table of Contents

  1. Enter the ninja
  2. Arming with testing and debugging
  4. Functions are fundamental
  5. Wielding functions
  6. Closing in on closures
  7. Object-orientation with prototypes
  8. Wrangling regular expressions
  9. Taming threads and timers
  11. Ninja alchemy: runtime code evaluation
  12. With statements
  13. Developing cross-browser strategies
  14. Cutting through attributes, properties, and CSS
  16. Surviving events
  17. Manipulating the DOM
  18. CSS selector engines

Frequently Bought Together

Secrets of the JavaScript Ninja + JavaScript: The Good Parts + Node.js in Action
Price for all three: $67.47

Buy the selected items together

Editorial Reviews

About the Author

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.

Bear Bibeault has been working in the area of web applications since the mid-nineties, getting started with beta versions of JSP and Servlets. He is a senior moderator at the popular JavaRanch site, and has contributed articles to the JavaRanch Journal as well as Dr Dobb's Journal online. He is a co-author of several Manning books including Ajax in Practice, Prototype and Scriptaculous in Action, jQuery in Action, and jQuery in Action, Second Edition. He works and resides in Austin, Texas.

Product Details

  • Paperback: 392 pages
  • Publisher: Manning Publications; 1 edition (December 28, 2012)
  • Language: English
  • ISBN-10: 193398869X
  • ISBN-13: 978-1933988696
  • Product Dimensions: 2.8 x 3.5 inches
  • Shipping Weight: 1.3 pounds (View shipping rates and policies)
  • Average Customer Review: 4.7 out of 5 stars  See all reviews (55 customer reviews)
  • Amazon Best Sellers Rank: #4,554 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

Most Helpful Customer Reviews
40 of 42 people found the following review helpful
5.0 out of 5 stars Great book for any js coder January 24, 2013
This book is a must-have for any serious js coder. It's almost guaranteed that you'll learn new tricks from this book. But more importantly your knowledge of the language will dramatically expand.

Bringing in a 'traditional' c/c++ background, js has been a 'pain' for me to deal with. I've been reading a few js books, tons of blogs and tuts, but very few expose the true nature of the language in a simple and pragmatic manner (way too many contrived examples out there, leading to greater confusion.) The kind of knowledge that keeps you from aiming at your foot... This book is it! I've been reading some of the chapters over and over to gain a deeper understanding of js. I then reviewed some of my previous code and realized that... shoot! I was gonna be limping soon.

Packed with information with an easy-read style, this book is already becoming a 'classic' for me. While not for beginners, if you're a programmer and learning js, I'd recommend you go through this book as you go. Most other js books focus on the syntax and usage but not so much on the language intricacies. For one, I tend to learn a language better if I also understand how it works.
Was this review helpful to you?
60 of 66 people found the following review helpful
Resig's earlier effort "Pro JavaScript Techniques" was a good read for its time but got spread thin by getting engrossed in the details of normalizing the DOM API which is something I already had for as my go-to and that subject is now increasingly less complicated the closer you get to ditching IE8 support.

This is in my experience, the first book to really properly focus on all of the stuff that comes together to really make JavaScript unique and powerful as a language, which has in the past been an understanding you could really only come to by tinkering with JS and reading/borrowing from generous web contributions from Resig, (maybe) Crockford, and IMO, JS-superstar whose name is not sung enough (not for a lack of trying by Resig among others) Dean Edwards whose background in Scheme helped him help the rest of us understand JS for the true complexity-reducing and normalizing beast that it is.

JS didn't come out on top as the only client-side browser option worth pursuing by accident and the view-point that we're "stuck" with it is one that should hopefully be hastily remedied by reading about and understanding what a marvel JS really is when you stop blaming it for Microsoft's tomfoolery and get over the fact that Eich wrote the original version in ten days. That was 17 years ago. JS has evolved constantly since then and hasn't spread to the server, OS, and become the ultimate pan-mobile solution by accident either.

My general sense of the writing is that Resig as always is good at distilling the seemingly complex into bite sized pieces while Bear makes them go down much more easily.
Read more ›
Was this review helpful to you?
39 of 42 people found the following review helpful
5.0 out of 5 stars Excellent for becoming a javascript guru February 4, 2013
I know I'm mixing my ethnic metaphors, but this book will help you get to ninjahood, guruhood, or whatever other hood you desire to attain. I am not an inexperienced coder: I have 30 years of experience in coding, including 17 years of java and probably 5 doing semi-serious JavaScript. Still, this book opened my eyes to so many things about JavaScript. For example: I knew about functions and I knew about closures, but the exact relationship between functions, objects, and closures had always eluded me. Knowing what you are doing when you say "new Function()". So many other things.

Face it: most of us look at JavaScript as a toy language. But that is only because most of the scripts we've seen have been toy scripts. We've never really seen the guts of a serious JavaScript library like jQuery, require.js, or impactJS. Once you do, you start seeing constructs you can hardly fathom coming from a background in conventional programming languages like java. JavaScript is a serious programming language, and one that is deceptively similar in syntax to java, even though it could hardly be further in semantics. Add to that the fact that there are libraries that make JavaScript look object-oriented, you can easily transport your object-oriented lines of thought into your JavaScript programming.

This book really gives you the ins and outs of JavaScript. Within a few pages I was either learning things I had never known about the language, or realizing how things I had seen actually work. What's more, it presents it in a "unit test" environment. I had always doubted how testable JavaScript was, and I must not be alone, because the book starts out talking about unit tests and presents many of the features using a unit test environment to show how they really work. I consider anything that gets us to write more automated tests - and I am as guilty as any - a good thing.

I highly recommend this book.
Was this review helpful to you?
25 of 27 people found the following review helpful
By S. Tang
I'll revise my review after I read more of this book, but I jumped right to the chapter on closures (Chapter 5.1) after I saw it in the table of contents.

I have never been satisfied with any definition on the internet or in Javascript books I have previously read. You can search for "Javascript closures" on the internet or at Stack Overflow and find (literally) dozens of explanations. I suppose the really smart coders can understand these explanations, but I found all of them to be unsatisfactory. All of them either had either abstract examples or explanations that never quite resonated with my meager mind.

This book nails it with an explanation that is actually straightforward and uses a simple code example (i.e. an outer function, an inner function, and some local and global variables; no arrays, no objects, etc.). The code example uses "hand-drawn" numbered callouts to explain important aspects of the code. I actually find these callouts superior to code comments, since the callout can "point" or "group" lines of code with an explanation and not be restricted by the format of a code comment.

For me, this chapter alone is worth the purchase price. Why? Javascript closures are apparently a popular interview question in some places, so understanding this topic is vital in more ways than one.
Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
5.0 out of 5 stars a must read
I'm a java developer going node.js addict

This book has been a real help in stepping my game up, it shows advanced use of the language and how misunderstood features may... Read more
Published 17 days ago by daplay
5.0 out of 5 stars Recommended
Amazing book. Despite having read a few intermediate level books prior to this I learned a lot in short order.

Highly recommended.
Published 23 days ago by David Gurr
2.0 out of 5 stars Needs to more clearly state for Advanced JS Developers
Not enough step by step, everything was extremely extract. At least build a ladder to which we can climb. Read more
Published 1 month ago by Quartz
5.0 out of 5 stars Amazing
Great book, a must have for any javascript enthusiast. Very clear, with examples, useful. Good for both beginners and seniors
Published 1 month ago by Diana
5.0 out of 5 stars Brilliant introduction to JavaScript
This is a really brilliant book that clearly explains WHY JavaScript has become the first choice for developing web applications on both client and server. Read more
Published 2 months ago by wizardbluebolt
5.0 out of 5 stars Must read JavaScript book for experienced developers trying to master...
Definitely not for beginners. JavaScript and its frameworks have a steep learning curve. I highly recommend that this book be read by people who have experience in an... Read more
Published 2 months ago by SSC
5.0 out of 5 stars Explaning why JavaScript is functional language
This book is heavily concentrated on explaining why JavaScript is a functional programming language and how that can be used by the developer. Read more
Published 2 months ago by Igor
3.0 out of 5 stars would have been cutting-edge several years ago...
One respect where the title is accurate in that this book is about coding Javascript directly, _not_ about coding to the interface of any library (like jQuery) that rides on top of... Read more
Published 2 months ago by C. Kollars
5.0 out of 5 stars Good Read
Even if you are already a 'Javascript Ninja', you will still likely find useful tips and insight in these pages.
Published 3 months ago by GRRuMble
3.0 out of 5 stars why is the cover samurai?
sorry, I hadn't read the book yet.
for those who read the book,
I am just curious, why the cover is using a samurai instead of ninja.
Published 3 months ago by Zhi Zeng
Search Customer Reviews
Only search this product's reviews

What Other Items Do Customers Buy After Viewing This Item?

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more


Search Customer Discussions
Search all Amazon discussions

Topic From this Discussion
This book is vaporware
Wow... now the date has been pushed back again (this time to March 2012). Before that it was starting to look like the book would have been released this coming weekend. I guess the art of JavaScript Ninjitsu is more elusive than Pocket Sasquatch.
Aug 26, 2011 by Clint V Franklin, aka theraje |  See all 14 posts
Anyone receive their copy yet?
I ordered a copy through Amazon and it just arrived - but the site still says that everything is delayed, I have no idea why. Manning definitely has copies in stock, though.
Jan 24, 2013 by John Resig |  See all 11 posts
Will this cover HTML5 JavaScript?
The book does not focus on specific APIs. Rather, it's focused on giving you a sound knowledge of JavaScript, and techniques for dealing with cross-browser issues and other complexities, making you the best of JavaScript developers. Which will, naturally, help you understand how to use the... Read more
Dec 20, 2012 by Bear Bibeault |  See all 6 posts
Kindle edition
Absolutely. It's available now from the Manning site.
Jan 25, 2013 by Bear Bibeault |  See all 3 posts
Start a new discussion
First post:
Prompts for sign-in

Look for Similar Items by Category