PARAM - Object Parameter

Syntax

<PARAM>

Attribute Specifications

NAME=CDATA (property name)
VALUE=CDATA (property value)
VALUETYPE=[ data | ref | object ] (type of value)
TYPE=ContentType (content-type of value resource)
[4.0] ID=string

Contents

Empty

Contained in

APPLET, OBJECT

Description

The PARAM element provides parameters for the OBJECT and APPLET elements. An OBJECT or APPLET may contain any number of PARAM elements prior to the alternate content that is also contained within the OBJECT or APPLET element.

NAME

The required NAME attribute of PARAM gives the name of the parameter while the VALUE attribute gives the parameter's value. The parameters recognized are specific to the kind of object being embedded or to the plug-in that renders the embedded object. For example, a clock applet may accept parameters to specify the style of the clock and the colors to use:

<OBJECT CLASSID="java:Clock.class" CODETYPE="application/java" WIDTH=100 HEIGHT=100 TITLE="A real live clock!" STANDBY="Do you know what time it is?">
<PARAM NAME=TYPE VALUE=ANALOG>
<PARAM NAME=BGCOLOR VALUE=WHITE>
<PARAM NAME=FGCOLOR VALUE=NAVY>
</OBJECT>

Note that the PARAM elements used in the preceding example would not change if the APPLET element were used in place of OBJECT.

Objects such as videos, audio clips, and VRML worlds are typically handled by browser plug-ins. Each plug-in recognizes certain parameters, which can make choosing parameters difficult when the author does not know which plug-in the user has. However, unsupported parameters should be safely ignored. The following example uses parameters specific to the QuickTime movie plug-in as well as parameters specific to the LiveAudio audio plug-in:

<OBJECT DATA="mlk.mov" TYPE="video/quicktime" TITLE="Martin Luther King's &quot;I Have a Dream&quot; speech" WIDTH=150 HEIGHT=150>
<PARAM NAME=pluginspage VALUE="http://quicktime.apple.com/">
<PARAM NAME=autoplay VALUE=true>
<OBJECT DATA="mlk.wav" TYPE="audio/x-wav" TITLE="Martin Luther King's &quot;I Have a Dream&quot; speech">
<PARAM NAME=autostart VALUE=true>
<PARAM NAME=hidden VALUE=true>
<A HREF="mlk.html">Full text of Martin Luther King's "I Have a Dream" speech</A>
</OBJECT>
</OBJECT>

Note that only the parameters specified within the OBJECT and prior to the alternate content are passed onto the plug-in, so that the pluginspage and autoplay parameters are used if the QuickTime movie is played while the autostart and hidden parameters are used if the audio clip is played.

VALUETYPE, VALUE & TYPE

The VALUETYPE parameter of PARAM designates the type of the VALUE attribute. The default value for VALUETYPE is data, which indicates that the VALUE attribute contains a string.

The ref value for VALUETYPE indicates that the VALUE attribute contains a url where run-time values are stored. The Internet media type of the resource is specified by the TYPE attribute. The following example uses values with VALUETYPE=ref to specify the location of images to animate and a sound to play durlng the animation:

<OBJECT CLASSID="java:Animator.class" CODETYPE="application/java" WIDTH=200 HEIGHT=300 TITLE="Wedding Photos">
<PARAM NAME=IMAGE1 VALUE="images/wedding/bride.jpg" VALUETYPE=ref TYPE="image/jpeg">
<PARAM NAME=IMAGE2 VALUE="images/wedding/groom.jpg" VALUETYPE=ref TYPE="image/jpeg">
<PARAM NAME=IMAGE3 VALUE="images/wedding/cake.jpg" VALUETYPE=ref TYPE="image/jpeg">
<PARAM NAME=SOUND VALUE="http://www.htmlhelp.com/sounds/weddingmarch.au" VALUETYPE=ref TYPE="audio/basic">
</OBJECT>

The url specified by VALUE is passed to the object without being resolved to a full URL. In the preceding example, the Java class would be responsible for resolving and fetching the contents of partial urls like "images/wedding/cake.jpg".

VALUETYPE also takes an object value, for use when a VALUE attribute specifies an identifier of a separate OBJECT in the document. The following example features a hypothetical application for interactively walking through the frames of an animated GIF. The GIF is loaded in a separate OBJECT from the application that uses it.

<OBJECT DECLARE ID=mygif DATA="animation.gif" TYPE="image/gif">
</OBJECT>
<OBJECT CLASSID="framepicker">
<PARAM NAME=image VALUE="#mygif" VALUETYPE=object>
<IMG SRC="animation.gif" ALT="[Example of an animated GIF]">
</OBJECT>

[4.0] ID

The ID attribute uniquely identifies an element within a document. No two elements can have the same ID value in a single document. The attribute's value must begin with a letter in the range A-Z or a-z and may be followed by letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

The following example uses the ID attribute to identify each of the first two paragraphs of a document:

<P ID=firstp>My first paragraph.</P>
<P ID=second>My second paragaph.</P>

The paragraphs in the example could have style rules associated with them through their ID attributes. The following Cascading Style Sheet defines unique colors for the two paragraphs:

P#firstp {
  color: navy;
  background: transparent
}

P#secondp {
  color: black;
  background: transparent
}

The paragraphs in the initial example could also be used as a target anchor for links:

<P>See <A HREF="#firstp">the opening paragraph</A> for more information.</P>

Note that most browsers do not support the ID attribute for link anchors. For current browsers, authors should use <A NAME>...</A> within the element instead of ID.

Since ID and NAME share the same name space, authors cannot use the same value for an ID attribute and a NAME attribute in the same document. Also note that while NAME may contain entities, the ID attribute value may not.

More Information