J. Blustein

CS3172 > Materials > Lecture Slides (file list) > Excerpt from HTML4

Web-centric Computing

[Course | Announcements | Mats | Resources]

Lecture Slides

Example of Graceful Degradation from HTML 4.01 Standard

An excerpt from the HTML 4.01 (Cougar) documentation. Where text has been deleted from the original […] has been inserted.


13 Objects, Images, and Applets

13.1 Introduction to objects, images, and applets

HTML's multimedia features allow authors to include images, applets (programs that are automatically downloaded and run on the user's machine), video clips, and other HTML documents in their pages.

[…] HTML 4 introduces the OBJECT element, which offers an all-purpose solution to generic object inclusion. The OBJECT element allows HTML authors to specify everything required by an object for its presentation by a user agent: source code, initial values, and run-time data. In this specification, the term "object" is used to describe the things that people want to place in HTML documents; other commonly used terms for these things are: applets, plug-ins, media handlers, etc.

[…]One significant consequence of the OBJECT element's design is that it offers a mechanism for specifying alternate object renderings; each embedded OBJECT declaration may specify alternate content types. If a user agent cannot render the outermost OBJECT, it tries to render the contents, which may be another OBJECT element, etc.

In the following example, we embed several OBJECT declarations to illustrate how alternate renderings work. A user agent will attempt to render the first OBJECT element it can, in the following order: (1) an Earth applet written in the Python language, (2) an MPEG animation of the Earth, (3) a GIF image of the Earth, (4) alternate text.

<P>                 <!-- First, try the Python applet -->
<OBJECT title="The Earth as seen from space" 
        classid="http://www.observer.mars/TheEarth.py">
                    <!-- Else, try the MPEG video -->
  <OBJECT data="TheEarth.mpeg" type="application/mpeg">
                    <!-- Else, try the GIF image -->
    <OBJECT data="TheEarth.gif" type="image/gif">
                    <!-- Else render the text -->
     The <STRONG>Earth</STRONG> as seen from space.
    </OBJECT>
  </OBJECT>
</OBJECT>

The outermost declaration specifies an applet that requires no data or initial values. The second declaration specifies an MPEG animation and, since it does not define the location of an implementation to handle MPEG, relies on the user agent to handle the animation. We also set the type attribute so that a user agent that knows it cannot render MPEG will not bother to retrieve "TheEarth.mpeg" from the network. The third declaration specifies the location of a GIF file and furnishes alternate text in case all other mechanisms fail. […]


Citation information for the original document

URI
<URL:http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html>
Title
HTML 4.01 Specification W3C Recommendation 24 December 1999
Editors
Dave Raggett
Arnaud Le Hors
Ian Jacobs
Copyright Notice
Copyright ©1997-1999 W3C®. (MIT, INRIA, Keio), All Rights Reserved.

http://www.cs.dal.ca/~jamie/course/CS/3172/Materials/Lecture/HTML/objects.shtml
Excerpt copied on
08 February 2003
Note
This excerpt falls under the provisions of fair use.
Version:
Wednesday, 10-Jun-2009 14:30:32 ADT
CS 3172 Prof.:
J. Blustein <jamie@cs.dal.ca>

This webpage uses valid XHTML 1.0