Sams Teach Yourself JavaScript in 24 Hours

Sams Teach Yourself JavaScript in 24 Hours

By Michael Moncur

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.

Share ThisShare This

Informit Network