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
Future Web Technologies
The Web has practically appeared out of nowhere over the course of a few years, and is continually changing. In the following sections, you will explore some of the upcoming—and already developed—technologies that will affect your pages and scripts.
Future versions of JavaScript
Since this is a book about JavaScript 1.5, you should be well aware that JavaScript has gone through several versions to reach its current status. Fortunately, the core language hasn't changed much through these version changes, and nearly all scripts written for older versions will work on the latest version.
The next version of JavaScript is likely to be version 2.0. While no date has been announced for its release, Netscape's development team and the ECMA agency are working on its specification. Version 2.0's main change will be the addition of true object-oriented features, such as classes and inheritance.
As with previous versions, version 2.0 should be backward compatible with older versions. To be sure your scripts will work under version 2.0, follow the standard language features and do not rely on any undocumented or browser-specific features.
Future DOM Versions
Currently, the W3C DOM level 1 is an official specification, while level 2 is only a recommendation. Level 2 adds features such as event handling and better style sheet support, and is already partially supported by Netscape 6.0, and Internet Explorer 5.0 and later.
In the future, expect better browser support for the DOM, and less compatibility issues between browsers. Future DOM versions will undoubtedly add more features, but no documentation yet exists for these versions.
XML (Extensible Markup Language)
HTML wasoriginally created as a language for the Web, and was based on an older standard for documentation called SGML (Standard Generalized Markup Language). HTML is a much-simplified version of SGML, specifically designed for Web documents.
A relatively new language on the scene is XML (Extensible Markup Language). While XML is also a simplified version of SGML, it isn't nearly as simple as HTML. While HTML has a specific purpose, XML can be used for virtually any purpose.
Strictly speaking, XML isn't a language in itself—there is no concise list of XML tags because XML has no set list of tags. Instead, XML allows you to create your own languages for whatever purpose you choose.
So what use is a language without any specific commands? Well, XML allows you to define languages for any purpose you choose. If you were storing recipes, for example, you could create tags for ingredients, ingredient quantities, and instructions.
XML uses a DTD (Document Type Definition) to define the tags used in a particular document. The DTD can be in a separate file or built into the document, and specifies which tags are allowed, their attributes, and what they can contain.
XML is already in use today. Although it isn't directly supported by Web browsers, you can use a program on the server to parse XML documents into HTML documents before sending them to the browser.
To return to the recipe example, an XML processor could convert each recipe into HTML. The reason for doing this is simple: By changing the rules in the parser, you could change the entire format of all of the recipes—a difficult task to perform manually if you had thousands of recipes.
XSL (Extensible Stylesheet Language)
XML documents focus strictly on the meaning of the tags—content—and ignore presentation. The presentation of XML can be determined by creating an XSL (Extensible Stylesheet Language) style sheet.
XSL is based on XML, but specifies presentation—parameters such as font size, margins, and table formatting-for an XML document. When you use an XML processing program to create HTML output, it uses an XSL stylesheet to determine the HTML formatting of the output.
Planning for the Future | Next Section

Account Sign In
View your cart