When I decided to write a book about JavaScript, I wanted to create it in a way that felt natural to how I learned the language. I didn’t learn it from school or a book; my JavaScript knowledge comes from real-world application, trial and error, and self-motivation. I wanted to present the information in a unique way so that you could get up to speed quickly, but still develop a solid base for the language and move forward without feeling overwhelmed with too much information. I combined my teaching experience with how I felt while I was learning to create an environment that moves quickly but has built-in break points and reviews to always keep the mind focused and clear. The JavaScript language can be confusing if taken all at once. There are hundreds of way to accomplish the same task, most of which you don’t need to know. I did my best throughout this book to not show too many ways to do the same thing, but rather focus on doing one thing really well.
The organization of this book is a little different from that of a normal JavaScript book. Often terms are introduced, explained in real-time, and readers can feel like they are taking in too much information at once. This can cause a loss of focus on the main task at hand. I addressed this issue by putting all the common JavaScript terms right up front in the book instead of piling them in a glossary that no one will read. As you go through them, they provide brief explanations of many core concepts in the language. This way we don’t have to spend valuable time giving broad definitions of miscellaneous terms and can focus on getting you the most knowledge out of this short time we have together.
The process of learning a robust language like JavaScript may seem intimidating at first, but don’t worry, it’s not that bad. After you grasp some of the basic ideas, the rest is like learning a spoken language; the hard part is properly organizing it, performance tuning, and most of all, knowing when to use CSS instead. Hopefully, by the time you’re finished reading this book, you will have gained the knowledge you need to effectively create a better user experience by responsibly using JavaScript.
JavaScript is a language with an amazingly rich history and an even brighter future. Throughout this book you learn the basics of the language, but at the same time you learn more advanced topics, such as HTML5 JavaScript APIs and how you create a touch-enabled interface. You can be assured that even though JavaScript is code, it’s far from boring; you can create some pretty wild interfaces and have a lot of fun in the process.
I hope this book can serve you well for years to come and will act as a launching pad for your continued interest in JavaScript. If this is the first step in your journey to learning JavaScript, welcome aboard; if you already know the language, welcome back.