[Contents] [Previous] [Next] [Index]

Applet

Includes a Java applet in a web page.

Client-side object

Implemented in

Navigator 3.0:

Created by

The HTML APPLET tag. The JavaScript runtime engine creates an Applet object corresponding to each applet in your document. It puts these objects in an array in the document.applets property. You access an Applet object by indexing this array.

To define an applet, use standard HTML syntax. If you specify the NAME attribute, you can use the value of that attribute to index into the applets array. To refer to an applet in JavaScript, you must supply the MAYSCRIPT attribute in its definition.

Description

The author of an HTML page must permit an applet to access JavaScript by specifying the MAYSCRIPT attribute of the APPLET tag. This prevents an applet from accessing JavaScript on a page without the knowledge of the page author. For example, to allow the musicPicker.class applet access to JavaScript on your page, specify the following:

<APPLET CODE="musicPicker.class" WIDTH=200 HEIGHT=35
   NAME="musicApp" MAYSCRIPT>
Accessing JavaScript when the MAYSCRIPT attribute is not specified results in an exception.

For more information on using applets, see the JavaScript Guide.

Property Summary

All public properties of the applet are available for JavaScript access to the Applet object.

Method Summary

All public methods of the applet

Examples

The following code launches an applet called musicApp:

<APPLET CODE="musicSelect.class" WIDTH=200 HEIGHT=35
   NAME="musicApp" MAYSCRIPT>
</APPLET>
For more examples, see the JavaScript Guide.

See also

MimeType, Plugin


[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 12:31:11


Copyright ?1997 Netscape Communications Corporation