Learn the Secrets of the JavaScript Ninja!

[UPDATE]Secrets of the JavaScript Ninja was published in December of 2012. Hard-copy can be purchased from any book-seller including Amazon and the Manning site (see links below). E-book formats are available at the book's Manning page (also see link below).

The book is not for the complete novice. But I strongly feel that Part 2 of the book, which includes an in-depth coverage of functions, closures, prototypes, and regex, should be read by everyone who writes JavaScript.

Here's an excerpt from the front matter on that subject:

1.2.1 Audience

This is not your first JavaScript book. If you're a complete novice to JavaScript, or you only understand a handful of statements by searching the web for code snippets, this is not the book for you. Yet.

This book is aimed at web developers who already have at least a basic grasp of JavaScript. You should understand the basic structure of JavaScript statements and how they work to create straightforward on-page scripts. You don't need to be an advanced user of the language -- that's what this book is for -- but you shouldn't be a rank novice.

You should also have a working knowledge of HTML and CSS. Again, nothing too advanced, but you should know the basics of putting a web page together.

If you want some good prerequisite material, grab one of the popular books on JavaScript and web development, and then tackle this one. We can recommend JavaScript: The Definitive Guide by David Flanagan, JavaScript: The Good Parts by Douglas Crockford, and Head First JavaScript by Michael Morrison.

Bear Bibeault wrote:The book is not for the complete novice. But I strongly feel that Part 2 of the book, which includes an in-depth coverage of functions, closures, prototypes, and regex, should be read by everyone who writes JavaScript.

Sounds like a plan - I might as well aim a little high, anyway. Best of luck with the book!

chris webster wrote: Sounds like a plan - I might as well aim a little high, anyway.

The nice thing about the way that book is structured, is that you can aim as high or low as you like by reading successive chapters and stopping when you've had enough.

As I said, Part 2* is accessible to just about anyone who has a basic knowledge of JavaScript. If you know what a for loop is, and can create and call a basic function, you can tackle part 2.

Part 3 is more advanced, but if you groked everything in part 2, you should be OK.

Part 4 is even more advanced. It's for those that really want to see how some of the esoteric things that libraries like jQuery and Prototype do are done.

You can stop when you think you've reached your personal zenith.

I think Part 2 is worth the cost of the book alone, and would benefit anyone writing JavaScript.

Best of luck with the book!

Thanks!

* The two chapters of Part 1 are just an intro, and a discussion about the state of debugging and testing tools. The only real "meat" is the development of an assert() function that we use throughout the rest of the book.

P.S. If you see this too late to act, if you wait until December 24th or 25th, you can try again. Manning will be running another sale then. I'll post the codes as the time approaches. (Or you can probably figure them out on your own if you look carefully at the code for today.)

Wow, I found this book by looking at John Resig's "Javascript and jQuery" talk on youtube. I googled his book Pro Javascript Techniques and because that was written in 2006, I continued to google to see if he had written anything else. I eventually landed on Amazon.com where this book is being sold. However, amazon.com states deliver is 1 to 2 months! I then zoomed on the book cover graphic to see the publisher so I could google them. That's where I saw the Manning publisher and googled them. And I found the book listed, but only in PDF form. I continued to follow links until I landed here at CodeRanch.com! Now, I see that here on this forum there has been alerts of discounts and I missed BOTH of them! Plus, I see that a poster got his book on last Saturday! I can hardly wait for the epub to be available on Jan. 15! This may be a dumb question, but does "pbook" mean printed book?

After reading sample chapter 1, I am so glad to read where John writes: "If you're reading this book, you know that there's nothing simpe about creating effective and cross-browser JavaScript code. " Ain't it the truth! I write HTML and CSS and fell in love with Javascript from the beginning circa 1999, however, back then applets were being used more often, then javascript kinda went under the radar and was kinda frowned upon by computer programmers. But a few years later, it resurfaced in the AJAX world web 2.0 and she was back in business! How I wished I could have learned the language back then, but there really wasn't much on the web for a self-learner like myself. I feel like I'm playing "catch up" because javascript "resurfaced" with such a bang and hasn't stopped since! I've bought quite a few books on javascript and jquery, but this one really excites me! For those of us who may not be able to afford to go back to school and get a CS degree, I'm hoping this book will really provide a solid understanding through reading. I truly believe that javascript needs to be learned as a programming language just like java or c#, it shouldn't be taken lightly. Thanks Bear for your post here "Important Info" that gives us a sneak peek into chapters of the book, why it was written and what readers will learn.

Hi, I'm in the middle of the fourth chapter and so far I like the book very much. I have very little practice with JavaScript but a little with Java and I did finish two or three tutorials on JavaScript. I think you have a very good way of explaining concepts and underlying assumptions that other books gloss over. Thanks a lot!

Thanks for the feedback! That's exactly what we set out to do. Most other JavaScript books gloss over some important details, or present how to write JavaScript without explaining the why. We though that was important.

I also made sure that the informatioin was accessible to people coming to JavaScript from a Java background; there are a lot of us!

I cannot for the life of me find a place to properly submit errata for this book (which I'm thoroughly enjoying by the way!).

So I believe that page 161 has an error in the regex.
(parseFloat(filter.match(/opacity=([^)]+/)[1]) / 100) + "" :
The closing parans for the capture group should be inside the closing regex literal forward slash. For example, I've isolated just the pertinent part and in chrome console: