
52
|
JavaScript Pocket Reference
Sending email and posting news
Scripts cannot submit forms to
mailto:ornews: URLs
without user confirmation.
Closing windows
A script can only close browser windows that it created
itself, unless it gets user confirmation.
Snooping in the cache
A script cannot load any
about: URLs, such as about:
cache
.
Hidden windows and window decorations
A script cannot create small or offscreen windows or
windows without a titlebar.
Note that this list of security restrictions is not static. As the
use of JavaScript has grown, advertisers and unsavory char-
acters have started doing annoying things with it. As a result,
newer browsers, such as Mozilla 1.0, allow user-config-
urable security restrictions that can prevent scripts from
opening new windows (such as pop-up ads), or from moving
or resizing existing windows.
JavaScript API Reference
The rest of this book contains a quick-reference for the core
and client-side JavaScript APIs. It documents the complete
core JavaScript API, covers the legacy (Level 0) DOM API,
and presents a simplified view of the W3C Level 2 DOM
API. Portions of that API not relevant to JavaScript program-
mers working with HTML documents have been omitted.
The upper-right corner of the title block for each reference
entry contains information that states whether a feature is
part of the core or client-side API, and further indicates
which version of JavaScript,