最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

doImport Method

Internet Development Index

Dynamically imports an element behavior.

Syntax

namespace.doImport(sUrl)

Parameters

sUrl Required. String that specifies the URL of the element behavior to import into the namespace.

Return Value

No return value.

Remarks

Once imported into a namespace by this method, an element behavior can be used on the page where the namespace has been declared.

Using this method alone is not enough to enable a element behavior to function on a Web page; it is also necessary to add a custom element to the body of the primary document, as illustrated in the following code snippet.

<body>
<myns:mycustomtag/>
</body>

The preceding sample shows how a custom element makes use of a custom namespace, which is declared on the XMLNS attribute of the HTML tag.

A script or binary behavior can also be used to insert a custom element. See the examples that follow for an illustration of this technique.

Examples

The following example declares a namespace called "TESTNS" and imports the default Microsoft® Internet Explorer behaviors into it.

<HTML XMLNS:TESTNS>
<HEAD>
<SCRIPT LANGUAGE="JScript">
document.namespaces("TESTNS").doImport("#default");
</SCRIPT>
</HEAD>

The following example shows how the doImport method can be used in conjunction with the createElement to insert a custom element to which an element behavior is attached.

<HTML xmlns:myns>
<BODY onload=Load()>
<SCRIPT>
var ns; // holds the newly created namespace object
function Load()
{
ns = document.namespaces[0];
ns.doImport("redbg.htc");
if(ns.readyState != "complete")
{
// Wait for the element behaviors to finish downloading
ns.attachEvent("onreadystatechange", addTagnamesToBody);
}
else
{
addTagnamesToBody();
}
return true;
}
function addTagnamesToBody()
{
if(ns.readyState != "complete") return;
var v = document.createElement("myns:abc");
v.innerText = "ElementBehavior";
document.body.appendChild(v);
ns.detachEvent("onreadystatechange", addTagnamesToBody);
}
</SCRIPT>
</BODY></HTML>

The following code shows the content of the HTML Component (HTC) file, redbg.htc, which simply applies a red background when the ondocumentready event fires.

<public:component tagName=abc >
<public:attach event=ondocumentready onevent=Doc_Ready() />
</public:component>
<script>
function Doc_Ready() {
element.document.bgColor = "red";
}
</script>

Standards Information

There is no public standard that applies to this method.

Applies To

namespace

See Also

IMPORT, Introduction to Viewlink, About Element Behaviors
梅州市| 定安县| 阳曲县| 高要市| 武山县| 漯河市| 大宁县| 益阳市| 富蕴县| 崇明县| 肃南| 罗源县| 南宫市| 广昌县| 桂林市| 武乡县| 友谊县| 建瓯市| 孝感市| 新邵县| 龙州县| 荣昌县| 松溪县| 河北区| 迁西县| 盐山县| 高雄县| 靖安县| 东至县| 甘南县| 牙克石市| 化州市| 蓬溪县| 来凤县| 上犹县| 杭州市| 合肥市| 河曲县| 深水埗区| 庄浪县| 桑植县|