iveConnect has two applet API packages: netscape.javascript and netscape.plugin.
The netscape.javascript applet API package has the following classes:
The netscape.plugin applet API package has the following classes:
The following sections describe these classes and list their constructors and methods.
The public final class JSObject extends Object.
java.lang.Object
|
+----netscape.javascript.JSObject
Values passed from JavaScript to Java are converted as follows:
(String) window.getMember("name")
(JSObject) window.getMember("document")
Note
If you call a Java method from JavaScript, this conversion happens automatically--you can pass in "int" argument and it works.
The netscape.javascript.JSObject class has the following methods:
The netscape.javascript.JSObject class has the following static methods:
Method | Description |
---|---|
getWindow
|
Gets a JSObject for the window containing the
given applet |
The following sections show the declaration and usage of these methods.
public Object call(String methodName,
Object args[])
public Object eval(String s)
Method. Retrieves a named member of a JavaScript object. Equivalent to "this.name" in JavaScript.
public Object getMember(String name)
public Object getSlot(int index)
Static method. Returns a JSObject for the window containing the given applet.
public static JSObject getWindow(Applet applet)
Method. Removes a named member of a JavaScript object.
public void removeMember(String name)
Method. Sets a named member of a JavaScript object. Equivalent to "this.name = value" in JavaScript.
public void setMember(String name,
Object value)
public void setSlot(int index,
Object value)
Method. Converts a JSObject to a String.
Overrides: toString in class Object
public String toString()
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.
The netscape.javascript.JSException class has the following constructors:
Constructor | Description |
---|---|
JSException
|
Constructs 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.
1. public JSException()
2. public JSException(String s)
3. public JSException(String s,
String filename,
int lineno,
String source,
int tokenIndex)
filename is the URL of the file where the error occurred, if possible.
lineno is the line number if the file, if possible.
source is the string containing the JavaScript code being evaluated.
tokenIndex is 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:
The public class Plugin extends Object.
java.lang.Object
|
+----netscape.plugin.Plugin
The netscape.plugin.Plugin class has the following constructors:
Constructor | Description |
---|---|
Plugin
|
Constructs a Plugin. |
The netscape.plugin.Plugin class has the following methods:
The following sections show the declaration and usage of these constructors and methods.
public void destroy()
NPP npp = (NPP)netscape_plugin_Plugin_getPeer(env, thisPlugin);
public int getPeer()
Method method. Returns the JavaScript window on which the plug-in is embedded.
public JSObject getWindow()
public void init()
public boolean isActive()
Constructor. Constructs a Plugin.
public Plugin()
file: /Techref/language/JAVA/script/packages.htm, 21KB, , updated: 2009/2/2 13:27, local time: 2024/11/19 11:34,
13.58.11.140:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/techref/language/JAVA/script/packages.htm"> The Netscape packages </A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.