You are here: Reference > JavaScript > client-side > HTML DOM > methods > doImport (namespace)

doImport method (namespace)

Browser support:
Imports the specified behavior file into the current namespace.
With the doImport method you can attach HTA or HTC files to namespaces. These files are useful to create custom elements, with custom functionality.
Element behaviors can be specified by style settings with the behavior property or by namespaces with the doImport method. For more information, visit the doImport (MSDN) page.

Syntax:

object.doImport (URL);
You can find the related objects in the Supported by objects section below.

Parameters:

URL
Required. Specifies the location of the element behavior to import.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the doImport method:
Code
hover.htc
<html xmlns:myNS="http://help.dottoro.com/NS">
<head>
    <script type="text/javascript">
        var namespace = document.namespaces("myNS");
        namespace.doImport("hover.htc");
    </script>
</head>
<body>
    <myNS:span>Move the mouse over this text (element with behavior)</myNS:span><br />
    <span>Move the mouse over this text (element without behavior)</span>
</body>
</html>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content