JSObject.setSlot() (Java method)

Stores an element in the JavaScript array.

Availability:

JavaScript - 1.1
Netscape - 3.0
Java syntax:myJSObject.setSlot(anIndex, "aValue")
Argument list:anIndexThe array index equivalent to [anIndex].
aValueThe new value to be stored in the array element

This method allows the Java code to set an element of a JavaScript array stored in a JSObject. There is a minor limitation in that you must pass a Java object and cannot set a primitive value.

The values passed to JavaScript will conform to the following conversions as they are passed to the JSObject methods:

JavaJavaScript
java.lang.BooleanJavaObject object
java.lang.DoubleJavaObject object
java.lang.IntegerJavaObject object
java.lang.StringJavaObject object
netscape.javascript.JSObjectgeneric JavaScript object
all other Java objectsJavaObject object

See also:Java to JavaScript values, JSObject object, LiveConnect