Exporter (0) Imprimer
Développer tout
EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

codebase attribute | codeBase property

Sets or retrieves the URL of the component.

Syntax

HTML<element codebase="p" ... >
JavaScript

p = object.codeBase

 

Property values

Type: String

the URL of the component, which can be appended with a version string of the form #Version=a,b,c,d, as described in the Remarks section. If the client computer has a later version installed, no download occurs.

ValueCondition
a

High-order word of the major version of the component available at the specified URL.

b

Low-order word of the major version of the component available at the specified URL.

c

High-order word of the minor version of the component available at the specified URL.

d

Low-order word of the minor version of the component available at the specified URL.

 

Remarks

Applets do not support version information supplied as part of the URL.

If a, b, c, and d are all set to -1 (#Version=-1,-1,-1,-1), the component is downloaded from the server if the release date is later than the installation date on the client computer. If the component is installed on the client computer and the release date is the same or earlier than the installation date, only an HTTP header transaction occurs.

The URL of the component cannot be a local path.

Windows Internet Explorer 8 or later. In IE8 Standards mode, the value of the codeBase attribute depends on the context of the reference to the attribute. When read as a Document Object Model (DOM) attribute, codeBase returns an absolute URL. The value specified by the page author is returned when codeBase is read as a content attribute, when the page is displayed in an earlier document compatibility mode, or when the page is viewed with an earlier version of the browser. For more information, see Attribute Differences in Internet Explorer 8.

Examples

The following example uses the CODEBASE attribute to specify the download location of the Common Dialog control.


<object id="CommonDialog1" width="32" HEIGHT="32"
    classid="CLSID:F9043C85-F6F2-101A-A3C9-08002B2F49FB"
    codebase="http://activex.microsoft.com/controls/vb5/comdlg32.cab
    #Version=1,0,0,0">
</object>

See also

applet
object
Managing Versions of a Component

 

 

Microsoft réalise une enquête en ligne pour recueillir votre opinion sur le site Web de MSDN. Si vous choisissez d’y participer, cette enquête en ligne vous sera présentée lorsque vous quitterez le site Web de MSDN.

Si vous souhaitez y participer,
Afficher:
© 2014 Microsoft