Executable Content Elements
One of the ways in which Web pages have become more dynamic is through their support of executable content, such as Java applets and ActiveX controls. These page elements are downloaded to the browser and run in its memory space to produce dynamic content on the browser screen.
XHTML 1.0 supports the <object> element for placing executable content. This element, along with the supporting <param/> element, is profiled in this section.
<object>
Type:
Container
Function:
Places an executable object on a page.
Syntax:
<object classid= "implementation_info" codebase="URL_of_object" codetype="MIME_type" data="URL_to_data" type="data_MIME_type" archive="list_of_archives" usemap="map_name" tabindex="tab_position" standby="message_while_loading" declare="declare" width="width_in_pixels_or_percentage" name="object_name" height="height_in_pixels_or_percentage"> ... </object>
Attributes:
The <object> element has an exhausting list of attributes, which makes it flexible enough to handle many different types of content (Java applets, ActiveX controls, and so on). These attributes include
-
archiveSet equal to a comma-delimited list of archive locations.
-
classidIdentifies which implementation or release of the object you're using.
-
codebaseSet equal to the URL of the object.
-
codetypeDescribes the code's MIME type.
-
dataSet equal to list of URLs where data for the object can be found.
-
declareInstructs the browser to declare, but not instantiate, a flag for the object.
-
standbyEnables you to display a message to the user while the object is loading.
-
typeSpecifies the MIME type of the data passed to the object.
-
usemapPoints to client-side map data, if image maps are used.
-
width and heightSpecifies the size of the object on the page.
Example:
<object width="100%" height="100" codetype="application/x-oleobject " classid="CLSID: 1A4DA620-6217-11CF-BE62-0080C72EDD2D" codebase="http://activex.microsoft.com/controls/iexplorer/marquee.ocx"> <param name="image" value="greeting.gif"/> <param name="speed" value="7"/> <param name="repeat" value= "1"/> ... </object>
Related Elements:
Parameters passed to the object are given by the <param /> element.
<param />
Type:
Standalone
Function:
Passes a parameter to an executable object placed by the <object> element.
Syntax:
<param id="unique_identifier" name="parameter_name" value="parameter_value" valuetype="data|ref|object" type="expected_content_type" />
Attributes:
The <param /> element can take the following attributes:
-
idAssigns a unique identifying name to the parameter.
-
nameProvides the name of the parameter.
-
typeTells the browser what the parameter's Internet media (MIME) type is.
-
valueSpecifies the value of the parameter.
-
valuetypeProvides more detail about the nature of the value being passed and can be set to data, ref, or object.
Example:
<object code="test.class" name="test"> <param id="p1" name="tolerance" value="0.001" valuetype="data" /> <param id="p2" name="pi" value="3.14159" valuetype="data" /> ... </object>
Related Elements:
<param /> elements can be used within an <object> element.
NOTE
The HTML <APPLET> element is not allowed under the Strict XHTML DTD, but you can use it with the Transitional and Frameset DTDs.