Partager via


async Property

 

Specifies whether asynchronous download is permitted.

Script Syntax

boolValue = oXMLDOMDocument.async;  
objXMLDOMDocument.async = boolValue;  

Example

The following example sets the async property of a DOMDocument object to false before loading books.xml.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");  
var comment;  
xmlDoc.async = false;  
xmlDoc.loadXML("<root><child/></root>");  
if (xmlDoc.parseError.errorCode != 0) {  
   var myErr = xmlDoc.parseError;  
   WScript.Echo("You have error " + myErr.reason);  
} else {  
   comment = xmlDoc.createComment("123456789");  
   WScript.Echo("Before deleting data: " + comment.xml);  
   comment.deleteData(3, 3);  
   WScript.Echo("After deleting data: " + comment.xml);  

Visual Basic Syntax

boolValue = oXMLDOMDocument.async  
objXMLDOMDocument.async = boolValue  

C/C++ Syntax

HRESULT get_async(  
    VARIANT_BOOL *isAsync);  
HRESULT put_async(  
    VARIANT_BOOL isAsync);  

Parameters

isAsync[out][in]
True if asynchronous download is permitted; False if not.

C/C++ Return Values

S_OK
The value returned if successful.

E_INVALIDARG (for get_async only)
The value returned if isAsync is Null.

Remarks

Boolean. The property is read/write. Returns True if asynchronous download is permitted; False if not. Default is True.

When set to True, the load method returns control to the caller before the download is finished. You can then use the readyState property to check the status of the download. You can also attach an onreadystatechange handler or connect to the onreadystatechange event to be notified when the ready state changes so that you know when the download is complete.

This member is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).

Versioning

Implemented in:

MSXML 3.0, MSXML 6.0

Applies to

IXMLDOMDocument-DOMDocument

See Also

onreadystatechange Property (DOMDocument)
onreadystatechange Event
readyState Property (DOMDocument)