Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The World Wide Web began as a simple repository for information, but it has grown into much more—it entertains, teaches, advertises, and communicates. As the Web has evolved, the tools have also evolved. Simple markup tools such as HTML have been joined by true programming languages—including JavaScript.
Now don't let the word "programming" scare you. For many, the term conjures up images of long nights staring at the screen, trying to remember which sequence of punctuation marks will produce the effect you need. (Don't get me wrong. Some of us enjoy that sort of thing.)
Although JavaScript is programming, it's a very simple language. As a matter of fact, if you haven't programmed before, it makes a great introduction to programming. It requires very little knowledge to start programming with JavaScript—you'll write your first program in Hour 2, “Creating a Simple Script.”
If you can create a Web page with HTML, you can easily use JavaScript to improve a page. JavaScript programs can range from a single line to a full-scale application. In this book, you'll start with simple scripts, and proceed to complex applications, such as a card game.
If you've spent much time developing pages for the Web, you know that the Web is constantly changing, and it can be hard to keep up with the latest languages and tools. This book will help you add JavaScript to your Web development toolbox, and I think you'll enjoy learning it.
I really had fun writing this book—and believe it or not, writing isn't always fun. I hope you'll have as much fun as you experiment with JavaScript and its capabilities.
This book is divided into 24 lessons. Each covers a single JavaScript topic, and should take about an hour to complete. The lessons start with the basics of JavaScript, and continue with more advanced topics. You can study an hour a day, or whatever pace suits you. (If you choose to forego sleep and do your studying in a single 24-hour period, you may have what it takes to be a computer book author.)
At the end of each hour's lesson, you'll find three final sections. Q&A answers a few of the most common questions about the hour's topic. The Quiz includes three questions to test your knowledge, and the Exercises offer ways for you to gain more experience with the techniques the hour covers.
Since JavaScript and the Web are constantly changing, you'll need to stay up-to-date after reading this book. This book's Web site, maintained by author Michael Moncur, includes the latest updates. The site also includes downloadable versions of the listings and graphics for the examples in this book. Here's the address:
If you have questions or comments about this book, have noticed an error, or have trouble getting one of the scripts to work, you can also reach the author by email at js15@starlingtech.com. (Please check the Web site first to see if your question has been answered.)