| Availability: |
| ||||||||
| Inherits from: | Element object | ||||||||
| JavaScript syntax: | - | myApplet = aName | |||||||
| - | myApplet = myAppletArray[aName] | ||||||||
| - | myApplet = myAppletArray[anIndex] | ||||||||
| IE | myApplet = myDocument.all.anElementID | ||||||||
| IE | myApplet = myDocument.all.tags("APPLET")[anIndex] | ||||||||
| IE | myApplet = myDocument.all[aName] | ||||||||
| - | myApplet = myDocument.aName | ||||||||
| - | myApplet = myDocument.applets[aName] | ||||||||
| - | myApplet = myDocument.applets[anIndex] | ||||||||
| - | myApplet = myDocument.getElementById(anElementID) | ||||||||
| - | myApplet = myDocument.getElementsByName(aName)[anIndex] | ||||||||
| - | myApplet = myDocument.getElementsByTagName("APPLET")[anIndex] | ||||||||
| HTML syntax: | <APPLET> ... </APPLET> | ||||||||
| Argument list: | aName | The name of an applet | |||||||
| anIndex | An element in the applets collection | ||||||||
| anElementID | The ID value of an Element object | ||||||||
| Object properties: | accessKey, align, alt, altHTML, archive, code, codeBase, dataFld, dataSrc, form, height, hspace, name, object, src, tabIndex, vspace, width | ||||||||
| Object methods: | start(), stop() | ||||||||
| Event handlers: | onAfterUpdate, onBeforeUpdate, onBlur, onClick, onDataAvailable, onDataSetChanged, onDataSetComplete, onDblClick, onErrorUpdate, onFocus, onHelp, onKeyDown, onKeyPress, onKeyUp, onLoad, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onReadyStateChange, onResize, onRowEnter, onRowExit | ||||||||
The properties and methods of an Applet object are inherited from the public properties and methods of the Java object it represents. However, in addition to these, MSIE also supports some additional properties.
The Java applet itself is the concrete object whose properties are accessed.
In Netscape, Applets are encapsulated as instances of the JavaObject class and communicate by means of the LiveConnect support. The mechanisms are quire different in MSIE, which uses ActiveX facilities to access applets.
When you access an Applet (JavaObject) object, you are really interacting with the Java applet itself.
The publicly accessible properties and methods depend on the applet, although all applets must support the start() and stop() methods.
It is generally safer to interact with methods that you have provided as custom additions to the applet, rather than hope that the applet supports any particular methods.
Because Java is so much more strongly data typed than JavaScript, you must be careful with the kind of values you try and send to and receive from a Java applet. Java will also not forgive the omission of an argument. In JavaScript, all arguments are assumed to be optional as a general rule, although leaving them out will have strange side effects sometimes. Java will not allow you to do this and a run time error will be generated if the arguments are not complete and all of the correct type.
In Netscape, you can build an enumerator loop to examine all the properties of an Applet object. Enumerating applet interfaces like this will yield a long list of function objects. Each function object represents an accessor for internal properties of the Java environment. Your applet may publish additional properties. With these functions, you can enquire about certain attributes of the applet and can change some of them from the script. Refer to the JavaObject topic for details about these generic capabilities, but bear in mind they only work in Netscape.
In MSIE, the APPLET object inherits its behavior from the Element object. Refer to the topic covering that for its generic properties and methods. MSIE supports many other properties and methods that are not generally available to Element objects and these are detailed here as properties and methods of the Applet object.
MSIE implements this object as a member of the class APPLET rather than Applet as you would expect.
Netscape implements it as a member of the class JavaObject , although this is masked by some shortcomings in the implementation that prevent it from displaying its class type.
<APPLET> tags are deprecated in HTML 4.0 and DOM level 1, which suggests there may be some changes to the JavaScript support for them in subsequent implementations of JavaScript in browsers.
| Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| accessKey | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | 0 ![]() | ![]() | ![]() |
, Deprecated |
| align | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| alt | 1.5 ![]() | 5.0 ![]() | 6.0 ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| altHTML | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| archive | 1.1 ![]() | 5.0 ![]() | 3.0 ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| code | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly |
| codeBase | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly |
| dataFld | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | 0 ![]() | ![]() | ![]() |
, Deprecated |
| dataSrc | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | 0 ![]() | ![]() | ![]() |
, Deprecated |
| form | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | 0 ![]() | ![]() | ![]() |
, Deprecated |
| height | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly |
| hspace | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| name | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly |
| object | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| src | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly |
| tabIndex | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | 0 ![]() | ![]() | ![]() |
, Deprecated |
| vspace | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| width | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly |
| Method | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| start() | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| stop() | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| Event name | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| onAfterUpdate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onBeforeUpdate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onBlur | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onClick | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onDataAvailable | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onDataSetChanged | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onDataSetComplete | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onDblClick | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onErrorUpdate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onFocus | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onHelp | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onKeyDown | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onKeyPress | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onKeyUp | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onLoad | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onMouseDown | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onMouseMove | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onMouseOut | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onMouseOver | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onMouseUp | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onReadyStateChange | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onResize | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onRowEnter | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onRowExit | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| Prev | Home | Next |
| Anonymous function | Up | Applet() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||