Perspective
The goal of this chapter has been to get you started with JavaScript and to get you started fast. Now, if you understand the Future Value application, you've come a long way. You should also be able to write basic JavaScript applications of your own. Keep in mind, though, that this chapter is just an introduction to the JavaScript essentials that will be expanded upon by the chapters in section 2.
Terms
Before you do the exercises for this book...
If you haven't already done so, you should install the Mozilla Firefox browser and install the applications for this book as described in appendix A. Then, if you're new to programming, you should do exercise 2-1. But if you have some programming experience, you can start with exercise 2-2.
Exercise 2-1 Build the Sales Tax application
This exercise is for beginners. It steps you through the process of building the Sales Tax application of chapter 1. This exercise also gives you a chance to do some experimenting, which is a great way to learn JavaScript programming.
Open the files for the Sales Tax application
Start the event handlers for this application
After you do each of the steps that follow, switch to Firefox, click the Reload button, and make sure your changes work. Otherwise, fix your code and try again.
Exercise 2-2 Enhance the Future Value application
In this exercise, you'll enhance the Future Value application in several ways. That will give you a chance to use some of the skills that you've learned in this chapter.
Test the Future Value application
Enhance the validity checking
Add a Clear button
Modify the calculation that's done
Disable and enable the text box for the annual interest rate
Add the date to the web page
Add a <noscript> tag to display a message when JavaScript is disabled
If you were able to do all of the steps in this exercise, congratulations!
You're well on your way to learning JavaScript and DOM scripting.