HTML and CSS Reference
In-Depth Information
The
codebase
Attribute
When a browser encounters a plug-in or an ActiveX control that it doesn't recognize, it
usually leaves a blank space where the embedded object normally would appear. One
way of dealing with this problem is to provide browsers with information about where a
working version of the plug-in or control can be downloaded. This is done by adding the
codebase
attribute
codebase=”
url
”
to the
object
element, where
url
is the filename and location of the program. In some
cases, these programs are stored in installation files called
cab
or
cabinet iles
, which
automatically install the necessary software on users' computers. You usually can find the
location of installation programs in the developer's documentation. For instance, for the
ActiveX QuickTime Player, the URL for the cabinet file is
www.apple.com/qtactivex/
qtplugin.cab
. Thus, to embed an object using the ActiveX version of the QuickTime
Player, you would enter the code
<object classid=”clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B”
parameters
</object>
in your Web page, where
parameters
is the object parameters associated with the
QuickTime video player. When Internet Explorer encounters this object, it first attempts
to insert the ActiveX QuickTime control into the Web page. If it can't find an ActiveX
control on the computer with that class id value, it then accesses the cab file at the URL
specified in the
codebase
attribute and prompts the user to install the ActiveX control
from that location. This frees the user from having to search for the program file.
Both the
classid
and
codebase
attributes were part of the specifications for the
object
element in HTML4; however, they are not part of the specifications for the
object
element in HTML5 and thus might not be supported by future browser versions.