XML DOM asyncProperty


Document object

Definition and Usage

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

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

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

Syntax

documentObject.async


Example

The following code snippet usesloadXMLDoc()put "books.xmlWhen loading into xmlDoc, the loadXMLDoc() function uses 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);
}


Document objectother extensions