
Error
78
|
JavaScript Pocket Reference
Error
predefined exception types
Core JavaScript 1.5; JScript 5.5; ECMA v3
Inherits From: Object
Constructor
new Error(message)
new EvalError(message)
new RangeError(message)
new ReferenceError(message)
new SyntaxError(message)
new TypeError(message)
new URIError(message)
These constructors create an instance of the Error class or of one
of its subclasses. The
message argument is optional.
Properties
Error and all of its subclasses define the same two properties:
message
An error message that provides details about the exception.
This property holds the string passed to the constructor, or an
implementation-defined default string.
name
A string that specifies the type of the exception. This prop-
erty is always the name of the constructor used to create the
exception object.
Methods
toString()
Returns a string representation of the Error (or subclass)
object.
Event
event details
DOM Level 2, IE 4, Netscape 4
Description
The Event object serves to provide both details about an event
and control over the propagation of an event. DOM Level 2
defines a standard Event object, but Internet Explorer 4, 5, and 6