|
|||||||
Basic concepts |
|||||||
|
|||||||
Advanced concepts |
|||||||
|
Although images were discussed earlier on in this HTML tutorial, they represent a limited subset of objects. In a nutshell, objects are instances of external data inserted in a page. They are designed to provide an infinitely extensible means of inserting content. Here's an example
<OBJECT data="image.jpg" type="image/jpeg"> An image </OBJECT>
And its IMG equivalent:
<IMG alt="An image" src="image.jpg">
Two attributes are sufficient for any object:
The data attribute is used to specify the location of object data. Object data include things such as images.
The classid attribute specifies the location of the object's implemenation. Object implementations include things like applets - whereas data is the subject of an implementation and has a subservient role, the classid attribute specifies the thing that can use the data. E.g.:
<OBJECT classid="http://www.foo.com/applet.java">
Note that objects frequently do not require both data and classid - one is usually all that is needed. For example, with images, the implementation can usually be done by the browser, so all that is needed is the data.
Conversely, many implementations do not require any data; for example, a clock applet probably wouldn't need any extra data.
Objects may appear both in the <HEAD> and <BODY> of documents. However, <OBJECT>s in the <HEAD> should not produce rendered content.
Certain other attributes also perform a useful function:
Browsers that can't render the content of <OBJECT> elements will try the content. E.g.:
<OBJECT classid="java.jar">
<OBJECT title="Will only be rendered if the java can't be used" type="image/gif"
data="image.gif">
Will only be rendered if the image and java can't be used.
</OBJECT>
</OBJECT>
You should always include alternate content inside <OBJECT> for non-object supporting browsers.
The <PARAM> element is used to specify parameters to be passed to an OBJECT. For example:
<OBJECT classid="java.jar">
<PARAM name="size" value="100" valuetype="data">
Alternate content here
</OBJECT>
The PARAM element takes four main attributes:
Given:
<OBJECT>
<PARAM>
<OBJECT>
<PARAM>
</OBJECT> </OBJECT>
only the child PARAM is used.
Declared OBJECTs may be run by use of an A element:
<OBJECT id="useme" declare data="video.mpeg">
</OBJECT>
<A href="#useme">Click to show video</A>
Or:
<OBJECT id="use" declare data="data.data">
</OBJECT>
<OBJECT classid="java.jar">
<PARAM name="data" valuetype="object" value="#use">
</OBJECT>
It is possible to embed web pages within web pages; this is done simply by setting data to a web page. E.g., <OBJECT data="webpage.html"></OBJECT>. However, inline frames offer a better alternative when you wish to change the embedded document - inline frames can have their content changed by HTML.
That's the end of this part of the HTML guide. The next section considers frames, so I suggest you click here to continue.
Copyright © RichInStyle.com 2000; all rights reserved. See copyright document for terms of use. Please visit Bukit Lawang flood appeal.