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, which browsers, or which ver-
sion of the DOM introduced the feature.
JavaScript API Reference
|
53
Because JavaScript is a loosely-typed language, there is not
an official set of class names for the classes and objects of the
JavaScript API, and they sometimes appear under different
names in different references. (For brevity, this book actually
uses a slightly different set of names than its big brother,
JavaScript: The Definitive Guide.) The following table sum-
marizes the reference entries that follow, and allows you to
quickly scan for the class or object you are interested in.
Anchor A named position in a document
Applet A Java applet
Arguments The arguments of a function
Array Array creation and manipulation
Attr An attribute of a document element
Boolean A wrapper object for boolean values
Comment An HTML comment
DOMException Signals DOM errors
DOMImplementation Creates documents, checks DOM features
Date Manipulates dates and times
Document An HTML document
DocumentFragment Nodes to be manipulated together
Element An HTML tag in a document
Error Predefined exception types
Event Event details
Form An HTML input form
Function A JavaScript function
Global Global properties and functions
History Browsing history
Image An HTML image
Input A form input element
Layer An independent document layer
Link An
<a> or <area> link
Location Current browser location
Math Mathematical functions and constants
Navigator Information about the browser
Node A node in a document tree
Number Support for numbers
Object The superclass of all JavaScript objects
Option A selectable option

Get JavaScript Pocket Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.