async Property

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Reference

async Property

Specifies whether asynchronous download is permitted.

[Script]

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.5.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode <> 0) {
   var myErr = xmlDoc.parseError;
   alert("You have error " + myErr.reason);
} else {
   alert(xmlDoc.xml);
}
[Visual Basic]

Visual Basic 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.

Dim xmlDoc As New Msxml2.DOMDocument50
xmlDoc.async = False
xmlDoc.Load ("books.xml")
If (xmlDoc.parseError.errorCode <> 0) Then
   Dim myErr
   Set myErr = xmlDoc.parseError
   MsgBox("You have error " & myErr.reason)
Else
   MsgBox xmlDoc.xml
End If
[C/C++]

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).

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

onreadystatechange Property | onreadystatechange Event | readyState Property

Applies to: DOMDocument