Perhaps the most exciting new features in Navigator 4.0 fall into
the category of "dynamic html". These are HTML and JavaScript
enhancements that allow Web pages to have much more dynamic
behavior.
-
Navigator 4.0 supports new <LAYER>
and <ILAYER> tags that allow HTML
text and objects to be positioned at absolute coordinates
within a window, and to be stacked on top of each other (hence
the name "Layer"). Layers function as sub-documents that can
be independently positioned, stacked, and hidden. They
support some dramatic new forms of JavaScript animation, as
well as giving Web-page designers pixel-level control over the
contents of a page. Each Document object has a
layers[] array listing the Layer objects it
contains, and each Layer object has a
document property that refers to the HTML
document it contains. Layers can be dynamically created with
the Layer() constructor.
-
Navigator 4.0 supports standard "Cascading Style Sheets" (CSS)
and also supports a variant known as "JavaScript Style Sheets"
(JSS). JavaScript style sheets provide essentially the same
functionality as cascading style sheets do, but allow
specification of document styles using JavaScript syntax,
instead of the special-purpose CSS syntax. Where CSS have a
purely descriptive syntax, JSS are described with a
programming language and thus have additional run-time
flexibility. JavaScript style sheets are an entirely new way
in which JavaScript is used in HTML documents. Besides being
used in event handlers and <SCRIPT>
tags, JavaScript can now be used in
<STYLE> tags as well.
-
Navigator 4.0 and JavaScript 1.2 support a much more flexible
event handling scheme. There is a new Event object that
contains properties that describe the details of an event.
Event handlers are now all passed an Event object when they
are invoked. In addition, there is a much larger set of event
handlers, and a well defined event-handling hierarchy. It is
possible, for example, for individual Layers to respond to
mouse events and individual keystrokes that occur over them.
- Miscellaneous related new features include new Window methods,
a new Screen object, and new properties of the Navigator
object. The window methods allow a program to resize and
re-position windows, bring up a Print dialog, activate the
Forward and Back browser buttons, and so on. Because
of the power of these new methods, most of them are restricted
to trusted scripts that have been digitally signed as
described above. The Screen object provides information about
the size and color depth of the screen on which Navigator is
running. This allows JavaScript applications to customize
themselves based on available screen real-estate, for example.
The Navigator object has new platform
and language properties that allow
JavaScript programs to customize themselves based on the
current platform and on the user's preferred language.