Name

JSObject: Java representation of a JavaScript object — Java class in Java plug-in

Synopsis

public final class netscape.javascript.JSObject extends Object

Methods

call( )

Invokes a method of the JavaScript object.

eval( )

Evaluates a string of JavaScript code in the context of the JavaScript object.

getMember( )

Gets the value of a property of the JavaScript object.

getSlot( )

Gets the value of an array element of the JavaScript object.

getWindow( )

Gets a “root” JSObject that represents the JavaScript Window object of the web browser.

removeMember( )

Deletes a property from the JavaScript object.

setMember( )

Sets the value of a property of the JavaScript object.

setSlot( )

Sets the value of an array element of the JavaScript object.

toString( )

Invokes the JavaScript toString( ) method of the JavaScript object and returns its result.

Description

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, invoking JavaScript methods, and 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.

Full details on programming with the JSObject can be found in Chapter 23.

See Also

Chapter 23, Chapter 12 ; JavaObject in Part III

Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.