Sams Teach Yourself JavaScript in 24 Hours
- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- We Want to Hear from You!
- Reader Services
- Introduction
- Part I: Getting Started
- Hour 1. Understanding JavaScript
- Hour 2. Creating a Simple Script
- Hour 3. How JavaScript Programs Work
- Part II: Learning JavaScript Basics
- Hour 4. Using Functions and Variables
- Hour 5. Using Strings and Arrays
- Hour 6. Testing and Comparing Values
- Hour 7. Repeating Yourself: Using Loops
- Hour 8. Using Math and Date Functions
- Part III: The Document Object Model (DOM)
- Hour 9. Working with the Document Object Model
- Hour 10. Responding to Events
- Hour 11. Using Windows and Frames
- Hour 12. Getting Data with Forms
- Hour 13. Using Graphics and Animation
- Part IV: Moving on to Advanced JavaScript Features
- Hour 14. Creating Cross-Browser Scripts
- Hour 15. Creating Custom Objects
- Hour 16. Working with Sounds and Plug-Ins
- Hour 17. Debugging JavaScript Applications
- Part V: Working with Dynamic HTML (DHTML)
- Hour 18. Working with Style Sheets
- Hour 19. Using Dynamic HTML (DHTML)
- Hour 20. Using Advanced DOM Features
- Part VI: Putting It All Together
- Hour 21. Improving a Web Page with JavaScript
- Hour 22. Creating a JavaScript Game
- Hour 23. Creating DHTML Applications
- Hour 24. JavaScript Tips and Tricks
- Part VII: Appendices
- Appendix A. Other JavaScript Resources
- Appendix B. Tools for JavaScript Developers
- Appendix C. Glossary
- Appendix D. JavaScript Quick Reference
- Appendix E. DOM Quick Reference
Tools for Scripting
Unlike many programming languages, you won't need any special software to create JavaScript scripts. In fact, you probably already have everything you need.
The first thing you'll need to work with JavaScript is a text editor. JavaScript scripts are stored in simple text files, usually as part of HTML documents. Any editor that can store ASCII text files will work.
You can choose from a wide range of editors, from simple text editors to word processors. If you don't have a favorite editor already, a simple editor is most likely included with your computer. For Windows computers, the Notepad accessory will work just fine.
A variety of dedicated HTML editors are also available and will work with JavaScript. In fact, many include features specifically for JavaScript—for example, color-coding the various JavaScript statements to indicate their purposes, or even creating simple scripts automatically.
For Windows computers, here are a few recommended editors:
- Homesite: An excellent HTML editor that includes JavaScript support.
- Microsoft Frontpage 2000: Microsoft's visual HTML editor. The Script Builder component allows you to easily create simple scripts.
- TextPad: A powerful text editor that includes a number of features missing from Notepad.
The following editors are available for both Windows and Macintosh:
- Macromedia Dreamweaver: a visually-oriented editor that works with HTML, JavaScript and Macromedia's Flash plug-in.
- Adobe GoLive: A visual and HTML editor that also includes features for designing and organizing the structure of large sites.
Additionally for the Macintosh, BBEdit, BBEdit Lite, and Alpha are good HTML editors that you can use to create Web pages and scripts.
You'll need two other things to work with JavaScript: a Web browser and a computer to run it on. Since this book covers new features introduced up to JavaScript 1.5, I recommend that you use the latest version of Netscape or Microsoft Internet Explorer. See the Netscape or Microsoft Web site to download a copy:
As a minimum, you should have Netscape 4.5 or later, or Internet Explorer 4.0 or later. Some of the advanced DHTML features covered beginning with Hour 18 will require Netscape 6.0 or later, or Internet Explorer 5.0 or later.
What Time is It? | Next Section

Account Sign In
View your cart