XML DOM async attribute
Definition and Usage
The async attribute specifies whether the download of an XML file should be processed synchronously.
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 can regain control.
Syntax:
documentObject.async
Example
In all examples, we will use the XML file books.xmlas well as JavaScript functions loadXMLDoc().
function loadXMLDoc(dname)
{
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
xmlDoc.async=false;
xmlDoc.load(dname);
return(xmlDoc);
}