跳到内容(1) Cob.com.cn

教程·Javascript 中文手册

您的位置:首页>>教程>>Javascript手册

netscape.javascript.JSException

The public class JSException extends Exception.

java.lang.Object
   |
   +----java.lang.Throwable
            |
            +----java.lang.Exception
                     |
                     +----netscape.javascript.JSException

JSException is an exception that is thrown when JavaScript code returns an error.

Constructors

The netscape.javascript.JSException class has the following constructors:

表 14.3 Constructors for the JSException class

Constructor描述
Constrqcts a JSException. You specify whether the JSException has a detail message and other information.

The following sections show the declaration and usage of these constructors.

JSException

Constructor. Constructs a JSException. You specify whether the JSException has a detail message and other information.

Declaration

1. public JSException()

2. public JSException(String s)

3. public JSException(String s,

String filename,

int lineno,

String source,

int tokenIndex)

参数

s The detail message.
filename The URL of the file where the error occurred, if possible.
lineno The line number if the file, if possible.
source The string containing the JavaScript code being evaluated.
tokenIndex The index into the source string where the error occurred.

描述

A detail message is a string that describes this particular exception.

Each form constructs a JSException with different information:

End Nav