HTML and CSS Reference
In-Depth Information The codebase attribute
Use the codebase attribute to provide an alternative base URL from which
the browser should retrieve an object. The value of this attribute is
a URL pointing to a directory containing the object referenced by the
classid attribute. The codebase URL overrides, but does not permanently
replace, the document's base URL, which is the default if you don't use
codebase . [ Referencing Documents: The URL, 6.2 ]
Continuing with our previous examples, suppose your document comes
from , but the clock applet is kept in a separ-
ate directory named classes . You cannot retrieve the applet by specify-
ing classid="classes/clock.class" . Rather, include the codebase attrib-
ute and new base URL:
<object classid="clock.class" codebase="">
which resolves to the URL:
Although we used an absolute URL in this example, you also can use
a relative URL. For instance, applets typically are stored on the same
server as the host documents, so we'd usually be better off, for reloca-
tion's sake, specifying a relative URL for the codebase , such as:
<object code="clock.class" codebase="/classes/">
The classid attribute is similar to the code attribute of the <applet> tag,
providing the name of the file containing the object; it is used in con-
Search WWH ::

Custom Search