In the netscape.javascript package included with Navigator 3.0
public final class netscape.javascript.JSObject extends Object
Invoke a method of the JavaScript object.
Evaluate a string of JavaScript code in the context of the JavaScript object.
Get the value of a property of the JavaScript object.
Get the value of an array element of the JavaScript object.
Get a "root" JSObject that represents the JavaScript Window object of the web browser.
Delete a property from the JavaScript object.
Set the value of a property of the JavaScript object.
Set the value of an array element of the JavaScript object.
Invoke the JavaScript toString() method of the JavaScript object, and return its result.
The JSObject is a Java class, not a JavaScript object; it cannot be used in your JavaScript programs, Instead, the JSObject is used by Java applets that wish to communicate with JavaScript by reading and writing JavaScript properties and array elements, by invoking JavaScript methods, and by evaluating and executing arbitrary strings of JavaScript code. Obviously, since JSObject is a Java class, you must understand Java programming in order to use it.
A Java applet that wishes to use the JSObject class must obtain an initial JSObject instance that represents the web browser window that the applet is running in. The JSObject class does not define a constructor method, so the only way to obtain this initial instance is by invoking the static getWindow() method, and passing it the java.applet.Applet instance that represents the applet. This static method returns a "root" JSObject instance, and you can use the getMember() and getSlot() methods to obtain any other JSObjects that the applet requires.
Note that if an applet uses the JSObject class, it must have the MAYSCRIPT attribute set in its <APPLET> tag, or it will not be allowed to manipulate JavaScript from Java. Also, an applet that uses the JSObject class should import the class with a line like the following:
import netscape.javascript.JSObject;
Full details on programming with the JSObject can be found in Chapter 19, LiveConnect: JavaScript and Java.
file: /Techref/language/java/SCRIPT/definitive/refp_184.htm, 7KB, , updated: 2019/10/14 15:00, local time: 2024/11/30 12:43,
18.224.59.107: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://techref.massmind.org/Techref/language/java/SCRIPT/definitive/refp_184.htm"> [Chapter 21] Reference: JSObject</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.