Click to Rate and Give Feedback
MSDN
MSDN Library
MSXML
DOM
DOM Reference
XML DOM Properties
 async Property

  Switch on low bandwidth view
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.

J#
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode != 0) {
   var myErr = xmlDoc.parseError;
   WScript.Echo("You have error " + myErr.reason);
} else {
   WScript.Echo(xmlDoc.xml);
}

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.

Visual Basic
Dim xmlDoc As New Msxml2.DOMDocument30
xmlDoc.async = False
xmlDoc.Load App.Path & "\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++ 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 2.0 and later

Applies to

See Also

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker