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.


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


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:
<html xmlns:myNS="">
    <script type="text/javascript">
        var namespace = document.namespaces("myNS");
    <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>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content