The OBJECT Element

HTML 4.0 deprecates the APPLET element. Instead you are supposed to use the OBJECT element. For the purposes of embedding applets, the OBJECT element is used almost exactly like APPLET except that the class attribute becomes the classid attribute. For example,

<object classid="MyApplet" 
codebase="http://www.foo.bar.com/classes" width="200" height="200"
align="right" hspace="5" vspace="10">
</object>

OBJECT elements are also used to embed ActiveX controls and other kinds of active content, and the tag has a few additional attributes to allow it to do that. However, for the purposes of Java you don't need to know about these.

You can support both by placing an APPLET element inside an OBJECT element like this:

<object classid="MyApplet" width="200" height="200">
<applet code="MyApplet" width="200" height="200">
</applet>
</object>

Browsers that understand <OBJECT> will ignore its content while browsers that don't will display its content.

PARAM elements are the same for OBJECT as for APPLET.

For the complete story, you can read about the OBJECT element in the HTML 4.0 specification.


Previous | Next | Top | Cafe au Lait

Copyright 1998, 2002, 2006 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified April 6, 2006