Declares a namespace for custom tags in an HTML document.
dhtml语法
HTML |
<HTML XMLNS:sNamespace ... >
|
---|
Scripting | N/A |
---|
DHTML可能的值
sNamespace | String that specifies the namespace used as a prefix to custom tags or a Uniform Resource Name (URN) that uniquely identifies the namespace. |
Remarks
The syntax for XMLNS is based on the w3c xml namespace spec . although the world wide web consortium (w3c) document allows you to declare namespaces on all tags, microsoft® internet explorer 5 supports namespace declaration only on the html tag.
you can declare multiple namespaces on the html tag, as the syntax below shows:
<html xmlns:prefix1 xmlns:prefix2="www.microsoft.com">
DHTML代码范例
This example shows how to declare a namespace when one of the default behaviors in internet explorer, clientcaps, is used as a custom tag in an html document. note that the declared namespace (in this case, msie) is a prefix to the name of the default behavior in the custom tag. this example also shows how the clientcaps behavior can be used to install the internet explorer data binding component, if the component does not already exist in the user's system.
<HTML XMLNS:MSIE>
<HEAD>
<STYLE>
@media all {
MSIE\:clientCaps {behavior:url(#default#clientcaps);}
}
</STYLE>
<SCRIPT>
function window.onload()
{
var bDataBindingAvailable = false;
var sDataBindingVersion = '';
var sDataBindingID =
"{333C7BC4-460F-11D0-BC04-0080C7055A83}";
bDataBindingAvailable =
oClientCaps.isComponentInstalled(sDataBindingID,"clsid");
// if data binding is unavailable, install it
if (!bDataBindingAvailable)
{
oClientCaps.addComponentRequest (sDataBindingID,
"componentid");
bDataBindingAvailable = oClientCaps.doComponentRequest();
}
:
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
:
<MSIE:CLIENTCAPS ID="oClientCaps" />
:
</BODY>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
是否符合公共标准
There is no public standard that applies to this attribute.
Applies To