JavaScript语言参考手册_LiveConnect 的 Java 包

JavaScript

 
 JavaScript手册 
目录
此参考中包含
的内容
轻松上手
简介
操作符
语句
核心
文档
窗口
表单
浏览器
事件和
事件句柄
LiveWire
数据库服务
进程管理服务
实用工具
全局函数
LiveConnect
的Java包
索引
版权
 
【目录】 【上一页】 【下一页】 【索引】

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 描述
JSException 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:

  • Form 1 of the declaration constructs a JSException without a detail message.
  • Form 2 of the declaration constructs a JSException with a detail message.
  • Form 3 of the declaration constructs a JSException with a detail message and all the other information that usually comes with a JavaScript error.


【目录】 【上一页】 【下一页】 【索引】

回页面顶部