SyntaxError : Error
Return to: JavaScript Core index

A SyntaxError is thrown if there is a syntax error in the JavaScript code.

Platform Support

IE Mozilla Netscape Opera Chrome Safari
5.0+ 1.0+ 6.0+ no no no

Constructors

Constructor Action IE Mozilla Netscape Opera Chrome Safari
SyntaxError Constructor([String message]) : SyntaxError
Creates a new instance of SyntaxError.
Show Details 5.0+ 1.0+ 6.0+ no no no

SyntaxError([String message]) : SyntaxError

Creates a new instance of SyntaxError.

Parameters
String message (optional)Error message that provides information about the exception.

Returns
SyntaxError

Properties

Property Action IE Mozilla Netscape Opera Chrome Safari
message : String
An error message associated with the SyntaxError.
Show Details 5.0+ 1.0+ 6.0+ no no no
Remarks
Contains either the error message passed to the constructor, or a default message.
See Also

Error.message

Availability

JavaScript 1.5|JScript 5.5|ECMAScript v3

name : String
Specifies the type of exception.
Show Details 5.0+ 1.0+ 6.0+ no no no
Availability

JavaScript 1.5|JScript 5.5|ECMAScript v3

Remarks

Can be thrown by the method, constructor, and the constructor.

References

Error|Error.message|Error.name

Availability

JavaScript 1.5|JScript 5.5|ECMAScript v3

text_javascript aptana_docs