Easy Tutorial
❮ Dom Prop Node Ownerdocument Prop Document Nodename ❯

XML DOM async Attribute



Definition and Usage

The async attribute specifies whether the download of an XML file should be handled asynchronously.

True means the load() method can return control to the calling program before the download is complete.

False means the download must be completed before the calling program retrieves control.

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc, with the loadXMLDoc() function utilizing the async attribute:

function loadXMLDoc(dname)
{
  try //Internet Explorer
  {
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
  catch(e)
  {
    try //Firefox, Mozilla, Opera, etc.
    {
      xmlDoc=document.implementation.createDocument("","",null);
    }
    catch(e) {
      alert(e.message)
    }
  }
  try
  {
    xmlDoc.async=false;
    xmlDoc.load(dname);
    return(xmlDoc);
  }
  catch(e) {
    alert(e.message)
  }
  return(null);
}

❮ Dom Prop Node Ownerdocument Prop Document Nodename ❯