Objects

The Image element is a historical relic from early versions of HTML. Today, images are only one of many forms of 'foreign' object that may be embedded in an XHTML document. Other options include sound and video clips, and program code (such as Java applets).

Object element

The Object element supersedes and extends the Image element. As its name implies, this element represents any 'foreign' object in an XHTML document, of which images are only one category. The Data attribute is a URL reference to the data to be loaded. The Type attribute is the MIME type of the data:

<object data="boat.gif" type="image/gif" ... />
<object data="bobbing_boat.mov"
        type="application/quicktime" ... />

Just as for images, an object can be given an area to work within using the Height and Width attributes. Also, the Usemap attribute may be used to make areas of the object act as hypertext links.

The Standby attribute holds text that is to be displayed until the object has been loaded.

Some additional attributes are intended for applications of the Object element that involve its use in loading software. When the object is a program, it may rely upon software libraries, possibly stored in archive files. A list of URL references to these archives can be supplied in the Archive attribute. Instead of the Data attribute, the Classid attribute may be used to identify the program to run. The Codetype attribute can be used in combination with this attribute to identify the data type, so that the browser can decide whether to download the object or not. Finally, it is possible to prevent immediate loading by including the Declare attribute, with its single possible value of 'declare'. A declared object is only loaded if it is referenced by another (loaded) object.

URLs provided in the Data and Classid attributes may be relative URLs, in which case the base location may need to be provided. This is done using the Codebase attribute.

The Object element can contain other elements. Browsers that do not understand the Object element should process the embedded elements (perhaps just an Image element). Browsers that do understand the Object element should ignore the embedded elements, and obey the Object element instead. When there is any doubt that a rendering engine could cope with a particular object type, it is also possible to put one object of a more generic type within another, more specific type. The first object that can be processed is used, and any embedded ones are ignored:

<object data="bobbing_boat.mov"
        type="application/quicktime" ... >
  <object data="boat.gif" type="image/gif" ... />
</object>

Parameters

The Parameter element, (Param), may be embedded within the Object element, and is used to pass parameters to a program launched by this object. There may be a number of parameters. Each empty element has two attributes, with the Name attribute supplying a parameter name, and the Value attribute supplying the value for this parameter:

<object data="file:///c:/programs/bobbingBoat.class" ...>
  <param name="sail_colour" value="red" />
  <param name="bobs_per_minute" value="15" />
</object>

It is further possible to specify what kind of value is being supplied. By default, the value is of type 'data', but using the Valuetype attribute, it can be set to 'ref' or 'object' instead. A 'ref' value is a URL reference. An 'object' value is a URL reference to another object in the XHTML document. The other object must have an Identifier attribute that matches the value of this parameter, and the entire remote object is passed to the current object.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.242.141